]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: standard: Wrong reallocation size.
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 26 Feb 2019 17:19:48 +0000 (18:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 Feb 2019 18:07:44 +0000 (19:07 +0100)
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.

src/standard.c

index 86dee4405e6e8174be0b13ff1d05146602fe8a33..24e014aa85c6016cbbb7ca02791b20fc6332b4a3 100644 (file)
@@ -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;