device-mapper ./WHATS_NEW lib/mm/dbg_malloc.c
CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: [email protected] 2007-01-15 14:39:12
Modified files:
. : WHATS_NEW
lib/mm : dbg_malloc.c
Log message:
Report error if NULL pointer supplied to dm_strdup_aux().
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.145&r2=1.146
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/mm/dbg_malloc.c.diff?cvsroot=dm&r1=1.8&r2=1.9
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 1.02.15 - =================================== + Report error if NULL pointer is supplied to dm_strdup_aux(). Reinstate dm_event_get_registered_device. Version 1.02.14 - 11th January 2007
lib/mm/dbg_malloc.c +7 -2
@@ -20,9 +20,14 @@char *dm_strdup_aux (const char *str,const char *file,int line) { -char *ret =dm_malloc_aux_debug (strlen (str) +1 , file, line); +char *ret; -if (ret) +if (!str) { +log_error ("Internal error: dm_strdup called with NULL pointer" ); +return NULL ; + } + +if ((ret =dm_malloc_aux_debug (strlen (str) +1 , file, line)))strcpy (ret, str);return ret;