summaryrefslogtreecommitdiff
path: root/mini_httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mini_httpd.c')
-rw-r--r--mini_httpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mini_httpd.c b/mini_httpd.c
index 762ca6c..b9c5c27 100644
--- a/mini_httpd.c
+++ b/mini_httpd.c
@@ -2407,7 +2407,8 @@ auth_check( char* dirname )
/* Yes. */
(void) fclose( fp );
/* So is the password right? */
- if ( strcmp( crypt( authpass, cryp ), cryp ) == 0 )
+ char *cryptpass = crypt( authpass, cryp );
+ if ((cryptpass != NULL) && (strcmp(cryptpass, cryp ) == 0) )
{
/* Ok! */
remoteuser = line;