s3:tests: Initialize pointers with NULL in netdisplay test
authorAndreas Schneider <asn@samba.org>
Fri, 16 Nov 2018 19:02:26 +0000 (20:02 +0100)
committerGary Lockyer <gary@samba.org>
Thu, 22 Nov 2018 21:13:26 +0000 (22:13 +0100)
Found by Undefined Sanitizer

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/lib/netapi/tests/netdisplay.c
source3/lib/netapi/tests/netuser.c

index 090792cec2f73947d127a0e6174ef61b641edf0f..d7967fa4150189c7898629f8a514402ac975539b 100644 (file)
@@ -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);
 
index de5f0a102d9efe9cb8934fe5d5d5b18970c37892..ad2bb53f18c98b82a030f03ed22b7586737cffac 100644 (file)
@@ -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);