summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-12-07 22:35:35 +0100
committerKarolin Seeger <kseeger@samba.org>2010-01-13 14:01:04 +0100
commit00b4f8eb86ede7728fc6f1c20d89de08f6b98f0c (patch)
tree9684a3485ee806e09cbc455965a1fc9cec098fd7 /source
parent3a102a75700c26c54ccf7801ef91d0db47550ae8 (diff)
downloadsamba-00b4f8eb86ede7728fc6f1c20d89de08f6b98f0c.tar.gz
samba-00b4f8eb86ede7728fc6f1c20d89de08f6b98f0c.tar.xz
samba-00b4f8eb86ede7728fc6f1c20d89de08f6b98f0c.zip
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). (cherry picked from commit 6aa17a7b82333de674274045f574bf6c0ce72638)
Diffstat (limited to 'source')
-rw-r--r--source/libsmb/clientgen.c2
1 files changed, 1 insertions, 1 deletions
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;
}