From ad89b09698b595f797a5f2273c7f1e16adcbc6fd Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 15 Jan 2001 23:59:26 +0000 Subject: [PATCH] * user_ops.c: reject NULL password in CtdlTryPassword() instead of crashing --- citadel/ChangeLog | 5 +++-- citadel/support.c | 1 + citadel/user_ops.c | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 16ccd7b57..e78ade588 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,6 +1,7 @@ $Log$ - Revision 573.69 2001/01/15 20:34:29 ajc - *** empty log message *** + Revision 573.70 2001/01/15 23:59:26 ajc + * user_ops.c: reject NULL password in CtdlTryPassword() instead of crashing + Revision 573.68 2001/01/15 20:34:04 ajc * "Path:" removed for now because it confuses brain-dead Microsoft shitware diff --git a/citadel/support.c b/citadel/support.c index 99284f6c7..e0a098fd4 100644 --- a/citadel/support.c +++ b/citadel/support.c @@ -23,6 +23,7 @@ void strproc(char *string) { int a; + if (string == NULL) return; if (strlen(string)==0) return; /* Convert non-printable characters to blanks */ diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 4350f630f..cf39c2403 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -494,6 +494,9 @@ int CtdlTryPassword(char *password) if (getuser(&CC->usersupp, CC->curr_user)) { return pass_internal_error; } + if (password == NULL) { + return pass_wrong_password; + } code = (-1); if (CC->usersupp.uid == BBSUID) { strproc(password); -- 2.39.2