1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

lvmcache: fix debug trace

Recent debug tracing commit introduce read of uninitialized memory,
since VGID is not really a proper string which ends with '\0'.
Enforce at most 32 (ID_LEN) chars are read from vgid.
(in release fix)
This commit is contained in:
Zdenek Kabelac 2014-03-19 23:35:36 +01:00
parent fc280bcc42
commit e5382c063d

View File

@ -446,8 +446,8 @@ struct lvmcache_vginfo *lvmcache_vginfo_from_vgname(const char *vgname, const ch
while ((vginfo = vginfo->next));
if (!vginfo)
log_debug_cache("Metadata cache has not found vgname \"%s\" with vgid \"%s\"",
vgname, vgid);
log_debug_cache("Metadata cache has not found vgname \"%s\" with vgid \"%."
DM_TO_STRING(ID_LEN) "s\".", vgname, vgid ? : "");
return vginfo;
}