From: wessels <> Date: Wed, 18 Feb 1998 01:15:22 +0000 (+0000) Subject: Fixed NULL pointer bug from a storeClientCopy callback. We sort of X-Git-Tag: SQUID_3_0_PRE1~4084 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d4f9bc83cc5bdeabed44b8e91c92f095231f93a;p=thirdparty%2Fsquid.git Fixed NULL pointer bug from a storeClientCopy callback. We sort of overloaded "size < 0" for these callbacks. Sometimes its a store-side failure (didn't open swap file), and sometimes its a client-side cancellation. If its cancelled from the client side we check that http->entry != NULL before proceeding with the request. --- diff --git a/src/client_side.cc b/src/client_side.cc index 44e8668993..db15196135 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.207 1998/02/12 07:03:04 wessels Exp $ + * $Id: client_side.cc,v 1.208 1998/02/17 18:15:22 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1078,9 +1078,17 @@ clientGetHeadersForIMS(void *data, char *buf, ssize_t size) memFree(MEM_4K_BUF, buf); buf = NULL; if (size < 0 || entry->store_status == STORE_ABORTED) { - debug(33, 1) ("clientGetHeadersForIMS: storeClientCopy failed for '%s'\n", - storeKeyText(entry->key)); - clientProcessMiss(http); + /* + * There are different reasons why we might have size < 0. One + * being that we failed to open a swapfile. Another being that + * the request was cancelled from the client-side. If the client + * cancelled the request, then http->entry will be NULL. + */ + if (entry != NULL) { + debug(33, 1) ("clientGetHeadersForIMS: storeClientCopy failed for '%s'\n", + storeKeyText(entry->key)); + clientProcessMiss(http); + } return; } if (mem->reply->code == 0) {