From e8ee29e9c183557e0f3df4691ee11167d1a8162f Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Sat, 24 Sep 2011 11:47:53 +0000 Subject: [PATCH] readlink does not append a null byte to the output string! --- libdm/libdm-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index b62b712fe..23539d72a 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);