r14176: Fix coverity bug #30. Ensure no possible null deref.
authorJeremy Allison <jra@samba.org>
Fri, 10 Mar 2006 23:22:38 +0000 (23:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:15 +0000 (11:15 -0500)
Jeremy.
(This used to be commit e5d6069cf88c0aa632af5582fcd7466729b20934)

source3/client/smbspool.c

index 245775bf6ae2b730dda9a917b6f913f3bb6a2efc..af2f7e9180c7eea2087b3001b62178ee2f94a4d0 100644 (file)
@@ -375,9 +375,14 @@ static struct cli_state
     return NULL;      
   }
     
-    
+  /* We pretty much guarentee password must be valid or a pointer
+     to a 0 char. */
+  if (!password) {
+    return NULL;
+  }
+  
   if ( (username) && (*username) && 
-      ((!password) || ((password) && (strlen(password) == 0 ))) && 
+      (strlen(password) == 0 ) && 
        (cli->use_kerberos) ) 
   {
     /* Use kerberos authentication */