]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix AuthBasicUserRequest::authenticated() assert checking the wrong value.
authoramosjeffries <>
Thu, 2 Aug 2007 10:15:26 +0000 (10:15 +0000)
committeramosjeffries <>
Thu, 2 Aug 2007 10:15:26 +0000 (10:15 +0000)
Was testing dynamic_cast input for NULL after the fact, should have been
 testing the output to include NULL from cast error as well as NULL input.

src/auth/basic/auth_basic.cc

index d47b7762fcfa96832584ed0c450a2f0150b5850e..68368c8e87062142395522ddeb2cd047a5812e18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: auth_basic.cc,v 1.49 2007/08/01 23:12:33 amosjeffries Exp $
+ * $Id: auth_basic.cc,v 1.50 2007/08/02 04:15:26 amosjeffries Exp $
  *
  * DEBUG: section 29    Authenticator
  * AUTHOR: Duane Wessels
@@ -143,7 +143,7 @@ int
 AuthBasicUserRequest::authenticated() const
 {
     BasicUser const *basic_auth = dynamic_cast<BasicUser const *>(user());
-    assert (user());
+    assert (basic_auth != NULL);
 
     if (basic_auth->authenticated())
         return 1;