From: hno <> Date: Fri, 24 Dec 2004 08:03:39 +0000 (+0000) Subject: Bug 954: Segment violation when using a blank user name in digest authentication X-Git-Tag: SQUID_3_0_PRE4~945 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba53f4b8538aa95e504a18eea88a534e046c0998;p=thirdparty%2Fsquid.git Bug 954: Segment violation when using a blank user name in digest authentication Forward ported by Kinkie --- diff --git a/include/config.h b/include/config.h index bca42f6ece..34a682524c 100644 --- a/include/config.h +++ b/include/config.h @@ -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 diff --git a/src/auth/basic/auth_basic.cc b/src/auth/basic/auth_basic.cc index e170719a24..a7e3aefe29 100644 --- a/src/auth/basic/auth_basic.cc +++ b/src/auth/basic/auth_basic.cc @@ -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); diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index f7927ba5ad..5b26c8c838 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -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 */ diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index 308fbbb61b..fe076200f7 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -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 */