blob: 2e4fdf8530f71738dbabb367e97b42dd9f88fab9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
---
mini_httpd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mini_httpd.c b/mini_httpd.c
index 03d0cdd..77f030f 100644
--- a/mini_httpd.c
+++ b/mini_httpd.c
@@ -2404,7 +2404,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;
|