Use *array() allocation functions where appropriate
This prevents overflow from multiplication. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
727275a027
commit
191f04f7dc
@@ -44,7 +44,7 @@ static char **list (char *s)
|
||||
member name, or terminating NULL). */
|
||||
if (i >= size) {
|
||||
size = i + 100; /* at least: i + 1 */
|
||||
members = reallocf (members, size * sizeof (char *));
|
||||
members = reallocarrayf (members, size, sizeof(char *));
|
||||
if (!members)
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user