aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2017-03-06 15:38:03 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2017-03-06 15:38:03 +0000
commit0012b66baf859a5f6177a6a66e1af0b8b7b3d24d (patch)
tree3576bbd529c1ce432ce163d43984e9f9b50feac0
parentbb7d0109d7e88a18d1eb22518f302c335d634af6 (diff)
downloadsrc-0012b66baf859a5f6177a6a66e1af0b8b7b3d24d.tar.gz
src-0012b66baf859a5f6177a6a66e1af0b8b7b3d24d.zip
libfetch: extra bounds checking through reallocarray(3).
Reviewed by: des MFC after: 1 week
Notes
Notes: svn path=/head/; revision=314778
-rw-r--r--lib/libfetch/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index e153bb5926a0..ba3217aa8a9c 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -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();