From c42bd7816325c460f07036101aab282049cd72df Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Mar 2020 09:54:48 +0100 Subject: [PATCH] rwrap: fix warning where %s is always passed a NULL pointer in rwrap_create_fake_uri_rr() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This happens in Samba's gitlab pipeline on Fedora 30/31: [3203/4410] Compiling third_party/resolv_wrapper/resolv_wrapper.c ==> /builds/samba-team/devel/samba/samba-o3.stderr <== ../../third_party/resolv_wrapper/resolv_wrapper.c: In function ‘rwrap_create_fake_uri_rr’: ../../third_party/resolv_wrapper/resolv_wrapper.c:104:33: error: ‘%s’ directive argument is null [-Werror=format-overflow=] 104 | # define RWRAP_LOG(dbglvl, ...) rwrap_log((dbglvl), __func__, __VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../third_party/resolv_wrapper/resolv_wrapper.c:340:3: note: in expansion of macro ‘RWRAP_LOG’ 340 | RWRAP_LOG(RWRAP_LOG_ERROR, | ^~~~~~~~~ ../../third_party/resolv_wrapper/resolv_wrapper.c:341:28: note: format string is defined here 341 | "Malformed URI entry [%s]\n", value); | ^~ cc1: all warnings being treated as errors Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- src/resolv_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolv_wrapper.c b/src/resolv_wrapper.c index bdf2c41..c88893e 100644 --- a/src/resolv_wrapper.c +++ b/src/resolv_wrapper.c @@ -309,7 +309,7 @@ static int rwrap_create_fake_uri_rr(const char *key, NEXT_KEY(str_prio, str_weight); if (uri == NULL) { RWRAP_LOG(RWRAP_LOG_ERROR, - "Malformed URI entry [%s]\n", value); + "Malformed URI entry []\n"); return -1; } -- 2.34.1