strv: use realloc_multiply() to check for multiplication overflow
This could overflow on 32bit, where size_t is the same as unsigned.
This commit is contained in:
parent
97569e154b
commit
14f27b4e3b
|
@ -392,7 +392,7 @@ int strv_push(char ***l, char *value) {
|
|||
if (m < n)
|
||||
return -ENOMEM;
|
||||
|
||||
c = realloc(*l, sizeof(char*) * (size_t) m);
|
||||
c = realloc_multiply(*l, sizeof(char*), m);
|
||||
if (!c)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in a new issue