Blame SOURCES/squid-4.4.0-CVE-2020-11945.patch

935e62
diff --git a/src/auth/digest/Config.cc b/src/auth/digest/Config.cc
935e62
index 45e46c0..433335a 100644
935e62
--- a/src/auth/digest/Config.cc
935e62
+++ b/src/auth/digest/Config.cc
935e62
@@ -94,9 +94,6 @@ static void authenticateDigestNonceDelete(digest_nonce_h * nonce);
935e62
 static void authenticateDigestNonceSetup(void);
935e62
 static void authDigestNonceEncode(digest_nonce_h * nonce);
935e62
 static void authDigestNonceLink(digest_nonce_h * nonce);
935e62
-#if NOT_USED
935e62
-static int authDigestNonceLinks(digest_nonce_h * nonce);
935e62
-#endif
935e62
 static void authDigestNonceUserUnlink(digest_nonce_h * nonce);
935e62
 
935e62
 static void
935e62
@@ -287,21 +284,10 @@ authDigestNonceLink(digest_nonce_h * nonce)
935e62
 {
935e62
     assert(nonce != NULL);
935e62
     ++nonce->references;
935e62
+    assert(nonce->references != 0); // no overflows
935e62
     debugs(29, 9, "nonce '" << nonce << "' now at '" << nonce->references << "'.");
935e62
 }
935e62
 
935e62
-#if NOT_USED
935e62
-static int
935e62
-authDigestNonceLinks(digest_nonce_h * nonce)
935e62
-{
935e62
-    if (!nonce)
935e62
-        return -1;
935e62
-
935e62
-    return nonce->references;
935e62
-}
935e62
-
935e62
-#endif
935e62
-
935e62
 void
935e62
 authDigestNonceUnlink(digest_nonce_h * nonce)
935e62
 {
935e62
diff --git a/src/auth/digest/Config.h b/src/auth/digest/Config.h
935e62
index b79ff30..2840865 100644
935e62
--- a/src/auth/digest/Config.h
935e62
+++ b/src/auth/digest/Config.h
935e62
@@ -44,7 +44,7 @@ struct _digest_nonce_h : public hash_link {
935e62
     /* number of uses we've seen of this nonce */
935e62
     unsigned long nc;
935e62
     /* reference count */
935e62
-    short references;
935e62
+    uint64_t references;
935e62
     /* the auth_user this nonce has been tied to */
935e62
     Auth::Digest::User *user;
935e62
     /* has this nonce been invalidated ? */