Published using Google Docs
squid-1699
Updated automatically every 5 minutes

squid-1699

Version:

2.6.S1

Bug link:

http://bugs.squid-cache.org/show_bug.cgi?id=1699

Symptom (Failure):
Assertion failed (auth_user_request != NULL failed).

How it is diagnosed:

We did not reproduce the failure, only analyzed the source & discussion threads.

Root Cause:

Squid forgot to check whether the pointer is NULL before feeding it into the assert. The fix is to only call the function containing the assert when the pointer is not NULL.

void authenticateAuthUserRequestUnlock(auth_user_request_t * auth_user_request) {

   assert(auth_user_request != NULL);

   if (auth_user_request->references > 0) {

}

--- authenticate.c        

+++ authenticate.c    
@@ -545,8 +545,10 @@ authenticateAuthenticate(auth_user_reque
  /* failed connection based authentication */
  debug(29, 4) ("authenticateAuthenticate: Auth user request %p
conn-auth user request %p conn type %d authentication failed.\n",
                *auth_user_request, conn->auth_user_request,
conn->auth_type);
-   authenticateAuthUserRequestUnlock(*auth_user_request);
-   *auth_user_request = NULL;

/* Calling authenticateAuthUserRequestUnlock only when *auth_user_request is not NULL! */
+   if (*auth_user_request) {
+                   authenticateAuthUserRequestUnlock(*auth_user_request);
+                   *auth_user_request = NULL;
+    }
   return AUTH_ACL_CHALLENGE;
 }

}

Is there any log message?:

Yes.

Can Errlog anticipate this log msg?

Yes. Safety check! The assertion was added to check against NULL before dereference!