Skip to contentSkip to conversation

LVM2/libdm libdm-common.c

PATCH [email protected] 1 participant 1 message Sep 24, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: prajnoha at sourceware.org 2011-09-24 11:47:53

Modified files:
libdm : libdm-common.c

Log message:
readlink does not append a null byte to the output string!

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.126&r2=1.127

libdm/libdm-common.c +1 -0
@@ -1145,6 +1145,7 @@
 		log_sys_error("readlink", sysfs_path);
 		return 0;
 	}
+	temp_path[size] = '\0';
 
 	if (!(kernel_dev_name = strrchr(temp_path, '/'))) {
 		log_error("Could not locate device kernel name in sysfs path %s", temp_path);