This change to StoreIO overlooked the signedness of the StoreIO* length
parameter. It may have resulted in objects that should not have been
store making their way into the cache.
Caches created by 3.0.STABLE10 release are known to contain many invalid
entries when rolled back to STABLE9 release. Whether or not these entries
are fatal to Squid is still unknown. It is currently expected that they
will be erased properly, but cause a lot of cache.log warnings while that
is happening. It is left to admin to decide if its worth purging their
cache on upgrade.
StoreIOBuffer():length(0), offset (0), data (NULL) {flags.error = 0;}
StoreIOBuffer(size_t aLength, int64_t anOffset, char *someData) :
- offset (anOffset), data (someData)
+ length (aLength), offset (anOffset), data (someData)
{
- /* maintain own state: detect size errors now */
- if (aLength <0) {
- flags.error = 1;
- length = 0;
- }
- else {
- flags.error = 0;
- length = aLength;
- }
+ flags.error = 0;
}
/* Create a StoreIOBuffer from a MemBuf and offset */
{
StoreIOBuffer result(sz, 0 ,copyInto.data);
- if (error) {
+ if (sz < 0) {
result.flags.error = 1;
+ result.length = 0;
+ } else {
+ result.flags.error = error ? 1 : 0;
}
result.offset = cmp_offset;