]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 954: Segment violation when using a blank user name in digest authentication
authorhno <>
Fri, 24 Dec 2004 08:03:39 +0000 (08:03 +0000)
committerhno <>
Fri, 24 Dec 2004 08:03:39 +0000 (08:03 +0000)
Forward ported by Kinkie

include/config.h
src/auth/basic/auth_basic.cc
src/auth/digest/auth_digest.cc
src/auth/ntlm/auth_ntlm.cc

index bca42f6ece2cf44fe56317b4a8ca2ac00ac5fe7b..34a682524cba14af0bf4545a43ed9f0a768ebf19 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.h,v 1.15 2004/12/21 17:28:27 robertc Exp $
+ * $Id: config.h,v 1.16 2004/12/24 01:03:39 hno Exp $
  *
  * AUTHOR: Duane Wessels
  *
@@ -362,6 +362,7 @@ typedef union {
 #define xispunct(x) ispunct((unsigned char)x)
 #define xisupper(x) isupper((unsigned char)x)
 #define xisxdigit(x) isxdigit((unsigned char)x)
+#define xisgraph(x) isgraph((unsigned char)x)
 
 #if HAVE_RANDOM
 #define squid_random random
index e170719a2402ae3fe1c10a4b05f7c6bee34e492a..a7e3aefe295308c6016b1218b7d7052c154394d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: auth_basic.cc,v 1.34 2004/12/20 16:30:38 robertc Exp $
+ * $Id: auth_basic.cc,v 1.35 2004/12/24 01:03:39 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Duane Wessels
@@ -527,7 +527,7 @@ AuthBasicConfig::decode(char const *proxy_auth)
     /* decode the username */
     /* trim BASIC from string */
 
-    while (!xisspace(*proxy_auth))
+    while (xisgraph(*proxy_auth))
         proxy_auth++;
 
     BasicUser *basic_auth, local_basic(&basicConfig);
index f7927ba5adaacfdf5caefad5465fabb464d8e571..5b26c8c838f0fe96a8f56a4a162505edcbd816cd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: auth_digest.cc,v 1.40 2004/12/20 19:13:54 robertc Exp $
+ * $Id: auth_digest.cc,v 1.41 2004/12/24 01:03:39 hno Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Robert Collins
@@ -1070,7 +1070,7 @@ AuthDigestConfig::decode(char const *proxy_auth)
 
     /* trim DIGEST from string */
 
-    while (!xisspace(*proxy_auth))
+    while (xisgraph(*proxy_auth))
         proxy_auth++;
 
     /* Trim leading whitespace before decoding */
index 308fbbb61b29e27345ff64936fa8d3f0c2b12fa3..fe076200f78eeadf5dc369713e662b6b76da2765 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: auth_ntlm.cc,v 1.45 2004/12/20 17:35:58 robertc Exp $
+ * $Id: auth_ntlm.cc,v 1.46 2004/12/24 01:03:39 hno Exp $
  *
  * DEBUG: section 29    NTLM Authenticator
  * AUTHOR: Robert Collins
@@ -709,7 +709,7 @@ AuthNTLMUserRequest::module_start(RH * handler, void *data)
         fatal("Invalid authenticate state for NTLMStart");
     }
 
-    while (!xisspace(*sent_string))    /*trim NTLM */
+    while (xisgraph(*sent_string))     /*trim NTLM */
         sent_string++;
 
     while (xisspace(*sent_string))     /*trim leading spaces */