------------------------------------------------------------ revno: 13900 revision-id: squid3@treenet.co.nz-20150829185119-ovu27x2a22e763do parent: squid3@treenet.co.nz-20150828132238-x8hudmdilr0dpzf1 committer: Amos Jeffries branch nick: 3.5 timestamp: Sat 2015-08-29 11:51:19 -0700 message: 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. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20150829185119-ovu27x2a22e763do # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 41d514e1910a3243cf12332ac2da098af5686fde # timestamp: 2015-08-29 19:49:37 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20150828132238-\ # x8hudmdilr0dpzf1 # # Begin patch === modified file 'src/tests/CapturingStoreEntry.h' --- src/tests/CapturingStoreEntry.h 2015-01-13 09:13:49 +0000 +++ src/tests/CapturingStoreEntry.h 2015-08-29 18:51:19 +0000 @@ -35,6 +35,8 @@ } 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); } };