diff options
author | Jeremy Allison <jra@samba.org> | 2002-12-28 01:23:34 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-12-28 01:23:34 +0000 |
commit | 5914c38a54fcfdb007352b152dc2206708d59af6 (patch) | |
tree | f2597c8b42b9a7d84266c041c8692378873d996e | |
parent | 91e2d21bd1401ca874c59f4d93f8b429c38b642d (diff) | |
download | samba-5914c38a54fcfdb007352b152dc2206708d59af6.tar.gz samba-5914c38a54fcfdb007352b152dc2206708d59af6.tar.xz samba-5914c38a54fcfdb007352b152dc2206708d59af6.zip |
Patch for coredump with missing arg from "Bradley W. Langhorst" <brad@langhorst.com>
Jeremy.
-rw-r--r-- | source/utils/pdbedit.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/utils/pdbedit.c b/source/utils/pdbedit.c index 45a63c4b64c..773af7c79a0 100644 --- a/source/utils/pdbedit.c +++ b/source/utils/pdbedit.c @@ -495,7 +495,14 @@ int main (int argc, char **argv) poptGetArg(pc); /* Drop argv[0], the program name */ if (user_name == NULL) { - user_name = poptGetArg(pc); + if (poptPeekArg(pc) == NULL) { + fprintf(stderr, "Can't use pdbedit without a username\n"); + poptPrintHelp(pc, stderr, 0); + exit(1); + } else { + /*Don't try to duplicate a null string */ + user_name = strdup(poptGetArg(pc)); + } } if (!lp_load(dyn_CONFIGFILE,True,False,False)) { |