r19424: Protect against username == NULL
authorJeremy Allison <jra@samba.org>
Fri, 20 Oct 2006 08:14:38 +0000 (08:14 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:15:34 +0000 (12:15 -0500)
Jeremy.
(This used to be commit 78b14de27a2220dc4a26d21d108242220b4a1598)

source3/utils/net.c

index a6fae57bc339721b16caaba23fb872cfecd5ca47..7b97476a25e67e74c0bd14e204191bda081ccd0d 100644 (file)
@@ -244,6 +244,9 @@ static char *get_user_and_realm(const char *username)
 {
        char *user_and_realm = NULL;
 
+       if (!username) {
+               return NULL;
+       }
        if (strchr_m(username, '@')) {
                user_and_realm = SMB_STRDUP(username);
        } else {
@@ -257,6 +260,7 @@ static char *get_user_and_realm(const char *username)
 /****************************************************************************
 connect to \\server\ipc$ using KRB5
 ****************************************************************************/
+
 NTSTATUS connect_to_ipc_krb5(struct cli_state **c,
                        struct in_addr *server_ip, const char *server_name)
 {