summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-10-21 14:36:03 +0200
committerMichal Schmidt <mschmidt@redhat.com>2014-10-21 14:36:03 +0200
commit14f27b4e3b009d10bb9a3b43b74585c73a7c7626 (patch)
treef6ef6d41d707c49a6ebd55a1c0289882ee82c9fe /src/shared
parent97569e154b80541cbad39d78231b7f360d4ff058 (diff)
strv: use realloc_multiply() to check for multiplication overflow
This could overflow on 32bit, where size_t is the same as unsigned.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/strv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c
index efa648df88..00857e40a7 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -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;