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
@@ -60,7 +60,7 @@ static const char *const noslash[] = {
|
||||
*/
|
||||
void initenv (void)
|
||||
{
|
||||
newenvp = (char **) xmalloc (NEWENVP_STEP * sizeof (char *));
|
||||
newenvp = (char **) xmallocarray (NEWENVP_STEP, sizeof (char *));
|
||||
*newenvp = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user