From fc0f9dc109b833855f0c92fcd6d7409e337aa6cb Mon Sep 17 00:00:00 2001 From: Jennifer Sutton Date: Thu, 20 Feb 2025 15:05:42 +1300 Subject: [PATCH] s3:lib: Initialize pointer to NULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ../../source3/lib/netapi/tests/netdisplay.c: In function ‘test_netquerydisplayinformation’: ../../source3/lib/netapi/tests/netdisplay.c:87:45: error: ‘current_name’ may be used uninitialized [-Werror=maybe-uninitialized] 87 | if (name && strcasecmp(current_name, name) == 0) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../source3/lib/netapi/tests/netdisplay.c:37:21: note: ‘current_name’ was declared here 37 | const char *current_name; | ^~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Jennifer Sutton Reviewed-by: Douglas Bagnall --- source3/lib/netapi/tests/netdisplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/netapi/tests/netdisplay.c b/source3/lib/netapi/tests/netdisplay.c index d7967fa4150..e1078e1daad 100644 --- a/source3/lib/netapi/tests/netdisplay.c +++ b/source3/lib/netapi/tests/netdisplay.c @@ -34,7 +34,7 @@ static NET_API_STATUS test_netquerydisplayinformation(const char *hostname, NET_API_STATUS status; uint32_t entries_read = 0; int found_name = 0; - const char *current_name; + const char *current_name = NULL; uint8_t *buffer = NULL; uint32_t idx = 0; int i; -- 2.47.3