mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
libfetch: extra bounds checking through reallocarray(3).
Reviewed by: des MFC after: 1 week
This commit is contained in:
parent
bb7d0109d7
commit
0012b66baf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314778
|
@ -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 a new issue