device-mapper-multipath/0030-libmultipath-fix-condlog-NULL-argument-in-uevent_get.patch
Benjamin Marzinski 2b0cd7cceb device-mapper-multipath-0.8.4-2
Rebased on top of Martin Wilck's queue of ACKed upstream commits
  * https://github.com/openSUSE/multipath-tools/tree/upstream-queue
  * All previous patches have been reordered, with the exception of
    0011-libdmmp-Add-support-for-upcoming-json-c-0.14.0.patch
    which has been replaced with
    0029-fix-boolean-value-with-json-c-0.14.patch
Modify 0054-RH-add-mpathconf.patch
  * remove default enable_foreign and property blacklist_exceptions
    settings, and deal with the builtin default change from
    0031-libmultipath-set-enable_foreign-to-NONE-by-default.patch.
    Fixes bz #1853668
Add 0048-Makefile.inc-trim-extra-information-from-systemd-ver.patch
Add 0049-kpartx-fix-Wsign-compare-error.patch
  * The above two patches have been submitted upstream
2020-07-08 23:16:57 -05:00

47 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 4 Jun 2020 18:20:06 -0500
Subject: [PATCH] libmultipath: fix condlog NULL argument in uevent_get_env_var
uevent_get_env_var() could call condlog with p == NULL. On gcc 10,
this triggers warnings like:
In file included from uevent.c:47:
In function 'uevent_get_env_var',
inlined from 'uevent_get_wwid' at uevent.c:170:8:
debug.h:13:2: error: '%s' directive argument is null
[-Werror=format-overflow=]
13 | dlog(logsink, prio, fmt "\n", ##args)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uevent.c:132:2: note: in expansion of macro 'condlog'
132 | condlog(4, "%s: %s -> '%s'", __func__, attr, p);
| ^~~~~~~
uevent.c: In function 'uevent_get_wwid':
uevent.c:132:25: note: format string is defined here
132 | condlog(4, "%s: %s -> '%s'", __func__, attr, p);
| ^~
If p is NULL, use "(null)" instead.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/uevent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
index d38e8a7f..e0d13b11 100644
--- a/libmultipath/uevent.c
+++ b/libmultipath/uevent.c
@@ -129,7 +129,7 @@ static const char* uevent_get_env_var(const struct uevent *uev,
}
}
- condlog(4, "%s: %s -> '%s'", __func__, attr, p);
+ condlog(4, "%s: %s -> '%s'", __func__, attr, p ?: "(null)");
return p;
invalid:
--
2.17.2