From f262f80a1c7c9206c028abe9e2157b1dc955333b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Jun 2009 15:29:35 -0700 Subject: [PATCH] Fix coverity #920. Possible NULL deref. Jeremy. --- source3/utils/pdbedit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 23c4e71e0d2..a4642994388 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"); -- 2.11.4.GIT