]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Ensure class Lock counter remains within bounds
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 21 Apr 2015 14:14:49 +0000 (07:14 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 21 Apr 2015 14:14:49 +0000 (07:14 -0700)
src/base/Lock.h

index 33eb51a3df7e4aa3f499b65a9f5bf91b43b07990..463c5d710e172ab74ce84180cd979d1061825434 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_SRC_BASE_LOCK_H
 #define SQUID_SRC_BASE_LOCK_H
 
+#include <cstdint>
+
 /**
  * This class provides a tracking counter and presents
  * lock(), unlock() and LockCount() accessors.
@@ -35,6 +37,7 @@ public:
 #if defined(LOCKCOUNT_DEBUG)
         old_debug(0,1)("Incrementing this %p from count %u\n",this,count_);
 #endif
+        assert(count_ < UINT32_MAX);
         ++count_;
     }