From ed2a0560ad23f3de0b63e4c48ce91e6d5c744c23 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 31 Oct 2014 13:04:46 +0100 Subject: [PATCH] libdm: init char array When non-root uses dm_check_version() it's been printing some unit values from stack. So always init those vars. --- WHATS_NEW_DM | 1 + libdm/ioctl/libdm-iface.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 6981f8f1e..6b5ee3a0f 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.91 - ==================================== + Don't print uninitialized stack bytes when non-root uses dm_check_version(). Fix selection criteria to not match reserved values when using >, <, >=, <. Add DM_LIST_HEAD_INIT macro to libdevmapper.h Fix dm_is_dm_major to not issue error about missing /proc lines for dm module. diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index c308fd26a..4c37a539b 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -544,7 +544,7 @@ static int _check_version(char *version, size_t size, int log_suppress) */ int dm_check_version(void) { - char libversion[64], dmversion[64]; + char libversion[64] = "", dmversion[64] = ""; const char *compat = ""; if (_version_checked)