From: Amos Jeffries Date: Sun, 28 Jun 2009 12:03:25 +0000 (+1200) Subject: Bug 2127: delay pools class 4 crashes with ntlm auth X-Git-Tag: SQUID_3_2_0_1~919 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98e025e135c59ccf78a2b35871232865d50ccf15;p=thirdparty%2Fsquid.git Bug 2127: delay pools class 4 crashes with ntlm auth pt 2: prevent NTLM handshake requests from being delayed prior to the authentication credentials being confirmed. Also adds a few more descriptive asserts to catch this bug if still live. --- diff --git a/src/DelayUser.cc b/src/DelayUser.cc index 9ddbe4d1dd..543a297c5a 100644 --- a/src/DelayUser.cc +++ b/src/DelayUser.cc @@ -77,6 +77,10 @@ static SplayNode::SPLAYCMP DelayUserCmp; int DelayUserCmp(DelayUserBucket::Pointer const &left, DelayUserBucket::Pointer const &right) { + /* Verify for re-currance of Bug 2127. either of these missing will crash strcasecmp() */ + assert(left->authUser->username() != NULL); + assert(right->authUser->username() != NULL); + /* for rate limiting, case insensitive */ return strcasecmp(left->authUser->username(), right->authUser->username()); } @@ -147,9 +151,10 @@ DelayUser::parse() DelayIdComposite::Pointer DelayUser::id(CompositePoolNode::CompositeSelectionDetails &details) { - if (!details.user) + if (!details.user || !details.user->user() || !details.user->user()->username()) return new NullDelayId; + debugs(77, 3, HERE << "Adding a slow-down for User '" << details.user->user()->username() << "'"); return new Id(this, details.user->user()); }