From 3da46073748c21a9202575883f3a57dacb2882ee Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Oct 2006 08:14:38 +0000 Subject: r19424: Protect against username == NULL Jeremy. (This used to be commit 78b14de27a2220dc4a26d21d108242220b4a1598) --- source3/utils/net.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3') diff --git a/source3/utils/net.c b/source3/utils/net.c index a6fae57bc3..7b97476a25 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -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) { -- cgit