[systemd-commits] src/shared

Michal Schmidt michich at kemper.freedesktop.org
Tue Oct 21 05:50:23 PDT 2014


 src/shared/strv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 14f27b4e3b009d10bb9a3b43b74585c73a7c7626
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Tue Oct 21 14:36:03 2014 +0200

    strv: use realloc_multiply() to check for multiplication overflow
    
    This could overflow on 32bit, where size_t is the same as unsigned.

diff --git a/src/shared/strv.c b/src/shared/strv.c
index efa648d..00857e4 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;
 



More information about the systemd-commits mailing list