wbinfo: Prevent client segfault with given EOF
authorGarming Sam <garming@catalyst.net.nz>
Mon, 27 Mar 2017 02:49:25 +0000 (15:49 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 Mar 2017 18:08:19 +0000 (20:08 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
nsswitch/wbinfo.c

index 57f2b3b..67a97b5 100644 (file)
@@ -1781,7 +1781,8 @@ static bool wbinfo_auth_crap(char *username, bool use_ntlmv2, bool use_lanman)
                                                get_winbind_netbios_name(),
                                                get_winbind_domain());
 
-               if (!SMBNTLMv2encrypt(NULL, name_user, name_domain, pass,
+               if (pass != NULL &&
+                   !SMBNTLMv2encrypt(NULL, name_user, name_domain, pass,
                                      &server_chal,
                                      &names_blob,
                                      &lm, &nt, NULL, NULL)) {