[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] 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,
-- 
Jun'ichi Nomura, NEC Corporation of America
Index: device-mapper.work/dmsetup/dmsetup.c
===================================================================
--- device-mapper.work.orig/dmsetup/dmsetup.c
+++ 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;
 	}

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]