libfetch: extra bounds checking through reallocarray(3).
Reviewed by: des MFC after: 1 week
This commit is contained in:
parent
bb7d0109d7
commit
0012b66baf
@ -1306,7 +1306,7 @@ fetch_add_entry(struct url_ent **p, int *size, int *len,
|
||||
}
|
||||
|
||||
if (*len >= *size - 1) {
|
||||
tmp = realloc(*p, (*size * 2 + 1) * sizeof(**p));
|
||||
tmp = reallocarray(*p, *size * 2 + 1, sizeof(**p));
|
||||
if (tmp == NULL) {
|
||||
errno = ENOMEM;
|
||||
fetch_syserr();
|
||||
|
Loading…
Reference in New Issue
Block a user