]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1031: Digest authentication crash
authorhno <>
Sat, 4 Sep 2004 03:25:29 +0000 (03:25 +0000)
committerhno <>
Sat, 4 Sep 2004 03:25:29 +0000 (03:25 +0000)
src/auth/digest/auth_digest.cc

index c3e3a40802f90de1003174c4242b35d6833a19b8..f70967b885b54e43c7dc024c219e52ceb6aa8c52 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: auth_digest.cc,v 1.34 2004/08/30 05:12:32 robertc Exp $
+ * $Id: auth_digest.cc,v 1.35 2004/09/03 21:25:29 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Robert Collins
@@ -821,7 +821,7 @@ authenticateDigestHandleReply(void *data, char *reply)
         if ((t = strchr(reply, ' ')))
             *t = '\0';
 
-        if (*reply == '\0')
+        if (*reply == '\0' || *reply == '\n')
             reply = NULL;
     }
 
@@ -833,7 +833,7 @@ authenticateDigestHandleReply(void *data, char *reply)
 
     if (reply && (strncasecmp(reply, "ERR", 3) == 0))
         digest_request->credentials(AuthDigestUserRequest::Failed);
-    else {
+    else if (reply) {
         CvtBin(reply, digest_user->HA1);
         digest_user->HA1created = 1;
     }