Change: xmemcpy(p, buf, len); to be: if (errflag == 0) { assert(len >= 0); xmemcpy(p, buf, len); } That should stop the crashes but it won't stop the IO errors and I'm not quite sure whether COSS will return crap to the client request or not. COSS should at least return a read failure back up to Squid and I'm sure things will be fine from there. Let me know if that stops the crashes and I'll go and commit a patch. Adrian