]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/String.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / String.cc
index 91bab6b434e283e6c6707a0529f5b6da59c3590a..dda09156021020cd59d902fa212b3647b557e893 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -41,7 +41,7 @@ void
 String::setBuffer(char *aBuf, String::size_type aSize)
 {
     assert(undefined());
-    assert(aSize < 65536);
+    assert(aSize <= SizeMax_);
     buf_ = aBuf;
     size_ = aSize;
 }
@@ -170,7 +170,7 @@ String::append( char const *str, int len)
     } else {
         // Create a temporary string and absorb it later.
         String snew;
-        assert(len_ + len < 65536); // otherwise snew.len_ overflows below
+        assert(canGrowBy(len)); // otherwise snew.len_ may overflow below
         snew.len_ = len_ + len;
         snew.allocBuffer(snew.len_ + 1);
 
@@ -469,3 +469,4 @@ String::rfind(char const ch) const
 #if !_USE_INLINE_
 #include "String.cci"
 #endif
+