From: Amos Jeffries Date: Fri, 21 Aug 2015 09:43:53 +0000 (-0700) Subject: Cleanup: fix assertion in Store unit tests X-Git-Tag: SQUID_4_0_1~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3da4d1a354b6c01ed1aa4a6d2536d6011ecf3ab;p=thirdparty%2Fsquid.git Cleanup: fix assertion in Store unit tests The old Squid String implementation cannot handle appending nullptr or negative lengths. So if the test code using CapturingStoreEntry ever tries to append such it will crash instead of working like a StoreEntry should. --- diff --git a/src/tests/CapturingStoreEntry.h b/src/tests/CapturingStoreEntry.h index 486ba5d7ba..e263e99d88 100644 --- a/src/tests/CapturingStoreEntry.h +++ b/src/tests/CapturingStoreEntry.h @@ -33,6 +33,8 @@ public: } virtual void append(char const * buf, int len) { + if (!buf || len < 0) // old 'String' can't handle these cases + return; _appended_text.append(buf, len); } };