Fix CID 1372600, possible NULL pointer dereference should
reallocarray() fail. Reported by: Coverity CID 1372600 MFC after: 1 week
This commit is contained in:
parent
a07d9e9af4
commit
ea5e026a0d
@ -2195,6 +2195,10 @@ char *phrase;
|
||||
for (i = 0, s = strtok(phrase, " \r\n\t"); s != NULL;
|
||||
s = strtok(NULL, " \r\n\t"), i++) {
|
||||
fb = reallocarray(fb, i / 4 + 1, sizeof(*fb));
|
||||
if (fb == NULL) {
|
||||
perror("memory allocation error at __LINE__ in __FUNCTION__ in __FILE");
|
||||
abort();
|
||||
}
|
||||
l = (u_32_t)strtol(s, NULL, 0);
|
||||
switch (i & 3)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user