diff options
author | Jeremy Allison <jra@samba.org> | 2009-06-19 15:29:35 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-06-19 15:29:35 -0700 |
commit | f262f80a1c7c9206c028abe9e2157b1dc955333b (patch) | |
tree | 2ad1d5fdc2690b75600a09f8a010329c61bcbe5b | |
parent | 1e989dbb91175a6e040117ac77bcd58fba877605 (diff) | |
download | samba-f262f80a1c7c9206c028abe9e2157b1dc955333b.tar.gz samba-f262f80a1c7c9206c028abe9e2157b1dc955333b.tar.bz2 samba-f262f80a1c7c9206c028abe9e2157b1dc955333b.zip |
Fix coverity #920. Possible NULL deref.
Jeremy.
-rw-r--r-- | source3/utils/pdbedit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 23c4e71e0d..a464299438 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -708,6 +708,10 @@ static int new_user(const char *username, const char *fullname, pwd1 = get_pass( "new password:", stdin_get); pwd2 = get_pass( "retype new password:", stdin_get); + if (!pwd1 || !pwd2) { + fprintf(stderr, "Failed to read passwords.\n"); + return -1; + } ret = strcmp(pwd1, pwd2); if (ret != 0) { fprintf (stderr, "Passwords do not match!\n"); |