Is being caleld at least once in squid3 with a NULL ptr and 0 length.
This patch prevents memory allocation on 0 length and a will continue
to assert if a NULL pointer is given with a length.
(We may want to re-think that later)
/*
- * $Id: String.cc,v 1.28 2008/01/23 19:24:14 rousskov Exp $
+ * $Id: String.cc,v 1.29 2008/01/23 20:51:16 amosjeffries Exp $
*
* DEBUG: section 67 String
* AUTHOR: Duane Wessels
String::limitInit(const char *str, int len)
{
PROF_start(StringLimitInit);
- assert(this && str);
+ if(len < 1) {
+ clean();
+ return;
+ }
+
+ assert(this && str && len > 0);
initBuf(len + 1);
len_ = len;
xmemcpy(buf_, str, len);