Skip to contentSkip to conversation

LVM2/libdm libdm-string.c

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

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-09-14 16:07:08

Modified files:
libdm : libdm-string.c

Log message:
Fix memory overwrite

Transfer of build_dm_uuid() function into libdm made uuid_prefix as parameter, thus sizeof() was replaced with strlen() and room for '\0' missed.

As it's only fix in current version - no whatsnew.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-string.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17

libdm/libdm-string.c +1 -1
@@ -347,7 +347,7 @@
 	if (!layer)
 		layer = "";
 
-	len = strlen(uuid_prefix) + strlen(lvid) + strlen(layer) + 1;
+	len = strlen(uuid_prefix) + strlen(lvid) + strlen(layer) + 2;
 
 	if (!(dmuuid = dm_pool_alloc(mem, len))) {
 		log_error("build_dm_name: Allocation failed for %" PRIsize_t