--------------------- PatchSet 4605 Date: 2007/05/19 06:28:41 Author: amosjeffries Branch: ayjwork Tag: (none) Log: Review of assert() usage. Now handles append(NULL) gracefully. Also now cores _before_ allocating more memory than can be used on init. Members: src/SqString.cc:1.1.2.5->1.1.2.6 Index: squid3/src/SqString.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SqString.cc,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid3/src/SqString.cc 18 May 2007 15:42:15 -0000 1.1.2.5 +++ squid3/src/SqString.cc 19 May 2007 06:28:41 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: SqString.cc,v 1.1.2.5 2007/05/18 15:42:15 amosjeffries Exp $ + * $Id: SqString.cc,v 1.1.2.6 2007/05/19 06:28:41 amosjeffries Exp $ * * DEBUG: section 67 String * AUTHOR: Duane Wessels @@ -42,6 +42,7 @@ { PROF_start(StringInitBuf); clear(); + assert(sz < 65536); buf_ = (char *)memAllocString(sz, &sz); assert(sz < 65536); size_ = sz; @@ -215,7 +216,7 @@ void SqString::append(char const *str) { - assert (str); + if(!str) return; append (str, strlen(str)); }