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:
Michal Schmidt 2014-10-21 14:36:03 +02:00
parent 97569e154b
commit 14f27b4e3b

View file

@ -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;