Skip to contentSkip to conversation

dmsetup: missing end of string

PATCH New Jun'ichi Nomura 1 participant 1 message Jun 19, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmsetup: missing end of string

Hi,

'devno' field of dmsetup info doesn't work.

# dmsetup info -c -o devno
dm_report: snprintf heading failed
dm_report: left-aligned snprintf() failed

There is a missing '\0' at the end of the copied strings.

Thanks,

Signature · 1 line
Jun'ichi Nomura, NEC Corporation of America
dmsetup/dmsetup.c +1 -1
Index: device-mapper.work/dmsetup/dmsetup.c
===================================================================
@@ -1629,7 +1629,7 @@ static int _dm_info_devno_disp(struct dm
 		goto out_abandon;
 	}
 
-	if (!dm_pool_grow_object(mem, buf, strlen(buf))) {
+	if (!dm_pool_grow_object(mem, buf, strlen(buf) + 1)) {
 		log_error("dm_pool_grow_object failed");
 		goto out_abandon;
 	}