summaryrefslogtreecommitdiffstats
path: root/libdm/libdm-common.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2011-09-24 11:47:53 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2011-09-24 11:47:53 +0000
commite8ee29e9c183557e0f3df4691ee11167d1a8162f (patch)
tree7bda0ead0fdab8074e02834ea87892552cfe9f08 /libdm/libdm-common.c
parentd36644c20d04e293b9419cb8d6151b117e52cc46 (diff)
downloadlvm2-e8ee29e9c183557e0f3df4691ee11167d1a8162f.tar.gz
lvm2-e8ee29e9c183557e0f3df4691ee11167d1a8162f.tar.xz
lvm2-e8ee29e9c183557e0f3df4691ee11167d1a8162f.zip
readlink does not append a null byte to the output string!
Diffstat (limited to 'libdm/libdm-common.c')
-rw-r--r--libdm/libdm-common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index b62b712f..23539d72 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -1145,6 +1145,7 @@ int dm_device_has_mounted_fs(uint32_t major, uint32_t minor)
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);