From: Adam Dickmeiss Date: Mon, 29 Oct 2007 09:23:08 +0000 (+0000) Subject: Fixed bug #1820: Omitted password crashes Zebra in some cases. X-Git-Tag: ZEBRA.2.0.20~97 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=7657d349adae01f0fa31b277f06778f23632ecd1;p=idzebra-moved-to-github.git Fixed bug #1820: Omitted password crashes Zebra in some cases. --- diff --git a/util/passwddb.c b/util/passwddb.c index f1e9f26..0c57801 100644 --- a/util/passwddb.c +++ b/util/passwddb.c @@ -1,4 +1,4 @@ -/* $Id: passwddb.c,v 1.17 2007-10-29 08:19:39 adam Exp $ +/* $Id: passwddb.c,v 1.18 2007-10-29 09:23:08 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -135,6 +135,8 @@ int passwd_db_auth(Passwd_db db, const char *user, const char *pass) break; if (!pe) return -1; + if (!pass) + return -2; if (pe->encrypt_flag) { #if HAVE_CRYPT_H @@ -142,8 +144,6 @@ int passwd_db_auth(Passwd_db db, const char *user, const char *pass) assert(pe->des); if (strlen (pe->des) < 3) return -3; - if (!pass) - return -2; if (pe->des[0] != '$') /* Not MD5? (assume DES) */ {