From dbdd57e31c09c71460eb2f7b0c646795682ebd88 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 16 Nov 2018 20:02:26 +0100 Subject: [PATCH] s3:tests: Initialize pointers with NULL in netdisplay test Found by Undefined Sanitizer Signed-off-by: Andreas Schneider Reviewed-by: Gary Lockyer --- source3/lib/netapi/tests/netdisplay.c | 6 +++--- source3/lib/netapi/tests/netuser.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source3/lib/netapi/tests/netdisplay.c b/source3/lib/netapi/tests/netdisplay.c index 090792cec2f..d7967fa4150 100644 --- a/source3/lib/netapi/tests/netdisplay.c +++ b/source3/lib/netapi/tests/netdisplay.c @@ -39,9 +39,9 @@ static NET_API_STATUS test_netquerydisplayinformation(const char *hostname, uint32_t idx = 0; int i; - struct NET_DISPLAY_USER *user; - struct NET_DISPLAY_GROUP *group; - struct NET_DISPLAY_MACHINE *machine; + struct NET_DISPLAY_USER *user = NULL; + struct NET_DISPLAY_GROUP *group = NULL; + struct NET_DISPLAY_MACHINE *machine = NULL; printf("testing NetQueryDisplayInformation level %d\n", level); diff --git a/source3/lib/netapi/tests/netuser.c b/source3/lib/netapi/tests/netuser.c index de5f0a102d9..ad2bb53f18c 100644 --- a/source3/lib/netapi/tests/netuser.c +++ b/source3/lib/netapi/tests/netuser.c @@ -265,8 +265,8 @@ static NET_API_STATUS test_netusergetgroups(const char *hostname, uint8_t *buffer = NULL; int i; - struct GROUP_USERS_INFO_0 *i0; - struct GROUP_USERS_INFO_1 *i1; + struct GROUP_USERS_INFO_0 *i0 = NULL; + struct GROUP_USERS_INFO_1 *i1 = NULL; printf("testing NetUserGetGroups level %d\n", level); -- 2.47.2