Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
memset with a size of 0 is forbidden
authorChristophe Thiéry <christopho128@gmail.com>
Fri, 28 Oct 2011 08:57:54 +0000 (10:57 +0200)
committerChristophe Thiéry <christopho128@gmail.com>
Fri, 28 Oct 2011 08:57:54 +0000 (10:57 +0200)
src/gras/DataDesc/ddt_convert.c

index e329d76..1d9c1cd 100644 (file)
@@ -197,7 +197,9 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
           padding = (*r_sign > 127) ? 0xff : 0;
         }
 
-        memset(l_data, padding, l_size);
+        if (l_size != 0) {
+          memset(l_data, padding, l_size);
+        }
         memcpy(!gras_arches[r_arch].endian ? l_data
                : ((char *) l_data + sizeChange), r_data, r_size);