From: Amos Jeffries Date: Tue, 21 Apr 2015 14:14:49 +0000 (-0700) Subject: Ensure class Lock counter remains within bounds X-Git-Tag: merge-candidate-3-v1~166 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d62d2dadc0cb623ff0d6b0f040d2adf173c12d2;p=thirdparty%2Fsquid.git Ensure class Lock counter remains within bounds --- diff --git a/src/base/Lock.h b/src/base/Lock.h index 33eb51a3df..463c5d710e 100644 --- a/src/base/Lock.h +++ b/src/base/Lock.h @@ -9,6 +9,8 @@ #ifndef SQUID_SRC_BASE_LOCK_H #define SQUID_SRC_BASE_LOCK_H +#include + /** * 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_; }