From: Frédéric Lécaille Date: Tue, 26 Feb 2019 17:19:48 +0000 (+0100) Subject: BUG/MEDIUM: standard: Wrong reallocation size. X-Git-Tag: v2.0-dev2~169 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12a718488a91810bfdead2aa59d751a92fe7a080;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: standard: Wrong reallocation size. The number of bytes to use with "my_realloc2()" in parse_dotted_nums() was wrong: missing multiplication by the size of an element of an array when reallocating it. --- diff --git a/src/standard.c b/src/standard.c index 86dee4405e..24e014aa85 100644 --- a/src/standard.c +++ b/src/standard.c @@ -4091,7 +4091,7 @@ int parse_dotted_uints(const char *str, unsigned int **nums, size_t *sz) if (*s != '\0'&& (*s++ != '.' || s == end)) return 0; - n = my_realloc2(n, *sz + 1); + n = my_realloc2(n, (*sz + 1) * sizeof *n); if (!n) return 0;