From 6aa17a7b82333de674274045f574bf6c0ce72638 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 7 Dec 2009 22:35:35 +0100 Subject: [PATCH] s3: Fix a segfault in "net" version 3.3 When neither LOGNAME nor -U is set, "net" and probably other client utils segfault. Reported by "vinnix" on irc. Volker Fix bug #6973 (segfault in client tools). --- source/libsmb/clientgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c index cb8f8279f51..2dbf67a4c99 100644 --- a/source/libsmb/clientgen.c +++ b/source/libsmb/clientgen.c @@ -408,7 +408,7 @@ void cli_init_creds(struct cli_state *cli, const char *username, const char *dom fstrcpy(cli->domain, domain); fstrcpy(cli->user_name, username); pwd_set_cleartext(&cli->pwd, password); - if (!*username) { + if ((username == NULL) || (!*username)) { cli->pwd.null_pwd = true; } -- 2.11.4.GIT