The Squid Team are pleased to announce the release of Squid-3.0.STABLE16.
+The Squid Team are pleased to announce the release of Squid-3.0.STABLE17.
This new release is available for download from http://www.squid-cache.org/Versions/v3/3.0/ or the mirrors.
diff -u -r -N squid-3.0.STABLE16/SPONSORS squid-3.0.STABLE17/SPONSORS --- squid-3.0.STABLE16/SPONSORS 2009-06-15 19:31:05.000000000 +1200 +++ squid-3.0.STABLE17/SPONSORS 2009-07-27 00:24:36.000000000 +1200 @@ -67,3 +67,9 @@ Barefruit has funded Squid3 development and maintenance, with a focus on the ICAP client support. + +Treehouse Networks, NZ - http://treenet.co.nz/ + + Treehouse Networks has contributed significant development resources + toward Squid-3 development and maintenance for their customer + gateways and CDN. diff -u -r -N squid-3.0.STABLE16/src/cache_cf.cc squid-3.0.STABLE17/src/cache_cf.cc --- squid-3.0.STABLE16/src/cache_cf.cc 2009-06-15 19:31:29.000000000 +1200 +++ squid-3.0.STABLE17/src/cache_cf.cc 2009-07-27 00:24:47.000000000 +1200 @@ -1598,6 +1598,22 @@ } /** + * utility function to prevent getservbyname() being called with a numeric value + * on Windows at least it returns garage results. + */ +static bool +isUnsignedNumeric(const char *str, size_t len) +{ + if (len < 1) return false; + + for (; len >0 && *str; str++, len--) { + if (! isdigit(*str)) + return false; + } + return true; +} + +/** \param proto 'tcp' or 'udp' for protocol \returns Port the named service is supposed to be listening on. */ @@ -1612,7 +1628,8 @@ return 0; /* NEVER REACHED */ } /** Returns either the service port number from /etc/services */ - port = getservbyname(token, proto); + if( !isUnsignedNumeric(token, strlen(token)) ) + port = getservbyname(token, proto); if (port != NULL) { return ntohs((u_short)port->s_port); } diff -u -r -N squid-3.0.STABLE16/src/client_side.cc squid-3.0.STABLE17/src/client_side.cc --- squid-3.0.STABLE16/src/client_side.cc 2009-06-15 19:31:30.000000000 +1200 +++ squid-3.0.STABLE17/src/client_side.cc 2009-07-27 00:24:47.000000000 +1200 @@ -1855,6 +1855,17 @@ /* pre-set these values to make aborting simpler */ *method_p = METHOD_NONE; + /* NP: don't be tempted to move this down or remove again. + * It's the only DDoS protection old-String has against long URL */ + if ( hp->bufsiz <= 0) { + debugs(33, 5, "Incomplete request, waiting for end of request line"); + return NULL; + } + else if ( (size_t)hp->bufsiz >= Config.maxRequestHeaderSize && headersEnd(hp->buf, Config.maxRequestHeaderSize) == 0) { + debugs(33, 5, "parseHttpRequest: Too large request"); + return parseHttpRequestAbort(conn, "error:request-too-large"); + } + /* Attempt to parse the first line; this'll define the method, url, version and header begin */ r = HttpParserParseReqLine(hp); @@ -2141,7 +2152,7 @@ // when we read chunked requests, the entire body is buffered // XXX: this check ignores header size and its limits. if (conn->in.dechunkingState == ConnStateData::chunkParsing) - return conn->in.notYetUsed < Config.maxChunkedRequestBodySize; + return ((int64_t)conn->in.notYetUsed) < Config.maxChunkedRequestBodySize; return conn->in.notYetUsed >= Config.maxRequestHeaderSize ? 0 : 1; } diff -u -r -N squid-3.0.STABLE16/src/client_side_reply.cc squid-3.0.STABLE17/src/client_side_reply.cc --- squid-3.0.STABLE16/src/client_side_reply.cc 2009-06-15 19:31:30.000000000 +1200 +++ squid-3.0.STABLE17/src/client_side_reply.cc 2009-07-27 00:24:47.000000000 +1200 @@ -637,10 +637,9 @@ return; } - /* - * Deny loops when running in accelerator/transproxy mode. - */ - if (http->flags.accel && r->flags.loopdetect) { + /// Deny loops for accelerator and interceptor. TODO: deny in all modes? + if (r->flags.loopdetect && + (http->flags.accel || http->flags.transparent)) { http->al.http.code = HTTP_FORBIDDEN; err = clientBuildError(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, NULL, @@ -1294,7 +1293,7 @@ LOCAL_ARRAY(char, bbuf, MAX_URL + 32); String strVia; hdr->getList(HDR_VIA, &strVia); - snprintf(bbuf, sizeof(bbuf), "%d.%d %s", + snprintf(bbuf, MAX_URL + 32, "%d.%d %s", reply->sline.version.major, reply->sline.version.minor, ThisCache); diff -u -r -N squid-3.0.STABLE16/src/ESI.cc squid-3.0.STABLE17/src/ESI.cc --- squid-3.0.STABLE16/src/ESI.cc 2009-06-15 19:31:27.000000000 +1200 +++ squid-3.0.STABLE17/src/ESI.cc 2009-07-27 00:24:46.000000000 +1200 @@ -1047,10 +1047,19 @@ assert (xstrncpy (pos, attr[i], sizeof(localbuf) + (pos - localbuf))); pos += strlen (pos); *pos++ = '='; - *pos++ = '\''; - assert (xstrncpy (pos, attr[i + 1], sizeof(localbuf) + (pos - localbuf))); + *pos++ = '\"'; + const char *chPtr = attr[i + 1]; + char ch; + while ((ch = *chPtr++) != '\0') { + if (ch == '\"') { + assert( xstrncpy(pos, """, sizeof(localbuf) + (pos-localbuf)) ); + pos += 6; + } else { + *(pos++) = ch; + } + } pos += strlen (pos); - *pos++ = '\''; + *pos++ = '\"'; } *pos++ = '>'; diff -u -r -N squid-3.0.STABLE16/src/fs/ufs/store_io_ufs.cc squid-3.0.STABLE17/src/fs/ufs/store_io_ufs.cc --- squid-3.0.STABLE16/src/fs/ufs/store_io_ufs.cc 2009-06-15 19:31:31.000000000 +1200 +++ squid-3.0.STABLE17/src/fs/ufs/store_io_ufs.cc 2009-07-27 00:24:47.000000000 +1200 @@ -363,17 +363,10 @@ } /* - * DPW 2007-04-12 - * I'm seeing disk files remain open under vanilla UFS storage - * because storeClose() gets called before the last write is - * complete. I guess we have to check for the try_closing - * flag here. + * HNO 2009-07-24 + * Kick any pending write/close operations alive */ - if (flags.try_closing) { - debugs(72, 2, HERE << "UFSStoreState::writeCompleted" << - " flags.try_closing is set"); - tryClosing(); - } + drainWriteQueue(); } void diff -u -r -N squid-3.0.STABLE16/src/helper.cc squid-3.0.STABLE17/src/helper.cc --- squid-3.0.STABLE16/src/helper.cc 2009-06-15 19:31:31.000000000 +1200 +++ squid-3.0.STABLE17/src/helper.cc 2009-07-27 00:24:47.000000000 +1200 @@ -99,7 +99,7 @@ shortname = xstrdup(progname); /* dont ever start more than hlp->n_to_start processes. */ - int need_new = hlp->n_to_start - hlp->n_running; + int need_new = hlp->n_to_start - hlp->n_active; debugs(84, 1, "helperOpenServers: Starting " << need_new << "/" << hlp->n_to_start << " '" << shortname << "' processes"); @@ -203,7 +203,8 @@ shortname = xstrdup(progname); /* dont ever start more than hlp->n_to_start processes. */ - int need_new = hlp->n_to_start - hlp->n_running; + /* n_active are the helpers which have not been shut down. */ + int need_new = hlp->n_to_start - hlp->n_active; debugs(84, 1, "helperOpenServers: Starting " << need_new << "/" << hlp->n_to_start << " '" << shortname << "' processes"); @@ -538,8 +539,8 @@ storeAppendPrintf(sentry, "program: %s\n", hlp->cmdline->key); - storeAppendPrintf(sentry, "number running: %d of %d\n", - hlp->n_running, hlp->n_to_start); + storeAppendPrintf(sentry, "number active: %d of %d (%d shutting down)\n", + hlp->n_active, hlp->n_to_start, (hlp->n_running - hlp->n_active) ); storeAppendPrintf(sentry, "requests sent: %d\n", hlp->stats.requests); storeAppendPrintf(sentry, "replies received: %d\n", @@ -580,7 +581,7 @@ storeAppendPrintf(sentry, " B = BUSY\n"); storeAppendPrintf(sentry, " W = WRITING\n"); storeAppendPrintf(sentry, " C = CLOSING\n"); - storeAppendPrintf(sentry, " S = SHUTDOWN\n"); + storeAppendPrintf(sentry, " S = SHUTDOWN PENDING\n"); } void @@ -591,8 +592,8 @@ storeAppendPrintf(sentry, "program: %s\n", hlp->cmdline->key); - storeAppendPrintf(sentry, "number running: %d of %d\n", - hlp->n_running, hlp->n_to_start); + storeAppendPrintf(sentry, "number active: %d of %d (%d shutting down)\n", + hlp->n_active, hlp->n_to_start, (hlp->n_running - hlp->n_active) ); storeAppendPrintf(sentry, "requests sent: %d\n", hlp->stats.requests); storeAppendPrintf(sentry, "replies received: %d\n", @@ -637,7 +638,7 @@ storeAppendPrintf(sentry, " B = BUSY\n"); storeAppendPrintf(sentry, " C = CLOSING\n"); storeAppendPrintf(sentry, " R = RESERVED or DEFERRED\n"); - storeAppendPrintf(sentry, " S = SHUTDOWN\n"); + storeAppendPrintf(sentry, " S = SHUTDOWN PENDING\n"); storeAppendPrintf(sentry, " P = PLACEHOLDER\n"); } @@ -664,7 +665,6 @@ hlp->n_active--; assert(hlp->n_active >= 0); - srv->flags.shutdown = 1; /* request it to shut itself down */ if (srv->flags.closing) { diff -u -r -N squid-3.0.STABLE16/src/helper.h squid-3.0.STABLE17/src/helper.h --- squid-3.0.STABLE16/src/helper.h 2009-06-15 19:31:31.000000000 +1200 +++ squid-3.0.STABLE17/src/helper.h 2009-07-27 00:24:47.000000000 +1200 @@ -61,9 +61,9 @@ dlink_list servers; dlink_list queue; const char *id_name; - int n_to_start; - int n_running; - int n_active; + int n_to_start; ///< Configuration setting of how many helper children should be running + int n_running; ///< Total helper children objects currently existing + int n_active; ///< Count of helper children active (not shutting down) int ipc_type; unsigned int concurrency; time_t last_queue_warn; @@ -86,9 +86,9 @@ dlink_list servers; dlink_list queue; const char *id_name; - int n_to_start; - int n_running; - int n_active; + int n_to_start; ///< Configuration setting of how many helper children should be running + int n_running; ///< Total helper children objects currently existing + int n_active; ///< Count of helper children active (not shutting down) int ipc_type; MemAllocator *datapool; HLPSAVAIL *IsAvailable; diff -u -r -N squid-3.0.STABLE16/src/http.cc squid-3.0.STABLE17/src/http.cc --- squid-3.0.STABLE16/src/http.cc 2009-06-15 19:31:31.000000000 +1200 +++ squid-3.0.STABLE17/src/http.cc 2009-07-27 00:24:47.000000000 +1200 @@ -85,7 +85,7 @@ surrogateNoStore = false; fd = fwd->server_fd; readBuf = new MemBuf; - readBuf->init(4096, SQUID_TCP_SO_RCVBUF); + readBuf->init(); orig_request = HTTPMSGLOCK(fwd->request); if (fwd->servers) diff -u -r -N squid-3.0.STABLE16/src/HttpMsg.cc squid-3.0.STABLE17/src/HttpMsg.cc --- squid-3.0.STABLE16/src/HttpMsg.cc 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/HttpMsg.cc 2009-07-27 00:24:46.000000000 +1200 @@ -150,20 +150,24 @@ buf->terminate(); // does not affect content size // find the end of headers - // TODO: Remove? httpReplyParseStep() should do similar checks const size_t hdr_len = headersEnd(buf->content(), buf->contentSize()); + // sanity check the start line to see if this is in fact an HTTP message + if (!sanityCheckStartLine(buf, hdr_len, error)) { + debugs(58,1, HERE << "first line of HTTP message is invalid"); + // NP: sanityCheck sets *error + return false; + } + // TODO: move to httpReplyParseStep() if (hdr_len > Config.maxReplyHeaderSize || (hdr_len <= 0 && (size_t)buf->contentSize() > Config.maxReplyHeaderSize)) { - debugs(58, 1, "HttpMsg::parse: Too large reply header (" << - hdr_len << " > " << Config.maxReplyHeaderSize); + debugs(58, 1, "HttpMsg::parse: Too large reply header (" << hdr_len << " > " << Config.maxReplyHeaderSize); *error = HTTP_HEADER_TOO_LARGE; return false; } if (hdr_len <= 0) { - debugs(58, 3, "HttpMsg::parse: failed to find end of headers " << - "(eof: " << eof << ") in '" << buf->content() << "'"); + debugs(58, 3, "HttpMsg::parse: failed to find end of headers (eof: " << eof << ") in '" << buf->content() << "'"); if (eof) // iff we have seen the end, this is an error *error = HTTP_INVALID_HEADER; @@ -171,30 +175,22 @@ return false; } - if (!sanityCheckStartLine(buf, error)) { - debugs(58,1, HERE << "first line of HTTP message is invalid"); - *error = HTTP_INVALID_HEADER; - return false; - } - const int res = httpMsgParseStep(buf->content(), buf->contentSize(), eof); if (res < 0) { // error - debugs(58, 3, "HttpMsg::parse: cannot parse isolated headers " << - "in '" << buf->content() << "'"); + debugs(58, 3, "HttpMsg::parse: cannot parse isolated headers in '" << buf->content() << "'"); *error = HTTP_INVALID_HEADER; return false; } if (res == 0) { - debugs(58, 2, "HttpMsg::parse: strange, need more data near '" << - buf->content() << "'"); + debugs(58, 2, "HttpMsg::parse: strange, need more data near '" << buf->content() << "'"); + *error = HTTP_INVALID_HEADER; return false; // but this should not happen due to headersEnd() above } assert(res > 0); - debugs(58, 9, "HttpMsg::parse success (" << hdr_len << " bytes) " << - "near '" << buf->content() << "'"); + debugs(58, 9, "HttpMsg::parse success (" << hdr_len << " bytes) near '" << buf->content() << "'"); if (hdr_sz != (int)hdr_len) { debugs(58, 1, "internal HttpMsg::parse vs. headersEnd error: " << @@ -379,9 +375,8 @@ packerClean(&p); } -HttpMsg * - // use HTTPMSGLOCK() instead of calling this directly +HttpMsg * HttpMsg::_lock() { lock_count++; diff -u -r -N squid-3.0.STABLE16/src/HttpMsg.h squid-3.0.STABLE17/src/HttpMsg.h --- squid-3.0.STABLE16/src/HttpMsg.h 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/HttpMsg.h 2009-07-27 00:24:46.000000000 +1200 @@ -94,7 +94,14 @@ void firstLineBuf(MemBuf&); protected: - virtual bool sanityCheckStartLine(MemBuf *buf, http_status *error) = 0; + /** + * Validate the message start line is syntactically correct. + * Set HTTP error status according to problems found. + * + * \retval true Status line has no serious problems. + * \retval false Status line has a serious problem. Correct response is indicated by error. + */ + virtual bool sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) = 0; virtual void packFirstLineInto(Packer * p, bool full_uri) const = 0; diff -u -r -N squid-3.0.STABLE16/src/HttpReply.cc squid-3.0.STABLE17/src/HttpReply.cc --- squid-3.0.STABLE16/src/HttpReply.cc 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/HttpReply.cc 2009-07-27 00:24:46.000000000 +1200 @@ -434,14 +434,52 @@ return content_length; } -bool HttpReply::sanityCheckStartLine(MemBuf *buf, http_status *error) +/** + * Checks the first line of an HTTP Reply is valid. + * currently only checks "HTTP/" exists. + * + * NP: not all error cases are detected yet. Some are left for detection later in parse. + */ +bool +HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) { - if (buf->contentSize() >= protoPrefix.size() && protoPrefix.cmp(buf->content(), protoPrefix.size()) != 0) { + // content is long enough to possibly hold a reply + // 4 being magic size of a 3-digit number plus space delimiter + if ( buf->contentSize() < (protoPrefix.size() + 4) ) { + if (hdr_len > 0) + *error = HTTP_INVALID_HEADER; + return false; + } + + // catch missing or mismatched protocol identifier + if (protoPrefix.cmp(buf->content(), protoPrefix.size()) != 0) { debugs(58, 3, "HttpReply::sanityCheckStartLine: missing protocol prefix (" << protoPrefix.buf() << ") in '" << buf->content() << "'"); *error = HTTP_INVALID_HEADER; return false; } + // catch missing or negative status value (negative '-' is not a digit) + int pos = protoPrefix.size(); + + // skip arbitrary number of digits and a dot in the verion portion + while ( pos <= buf->contentSize() && (*(buf->content()+pos) == '.' || xisdigit(*(buf->content()+pos)) ) ) ++pos; + + // catch missing version info + if (pos == protoPrefix.size()) { + debugs(58, 3, "HttpReply::sanityCheckStartLine: missing protocol version numbers (ie. " << protoPrefix << "/1.0) in '" << buf->content() << "'"); + *error = HTTP_INVALID_HEADER; + return false; + } + + // skip arbitrary number of spaces... + while (pos <= buf->contentSize() && (char)*(buf->content()+pos) == ' ') ++pos; + + if (!xisdigit(*(buf->content()+pos))) { + debugs(58, 3, "HttpReply::sanityCheckStartLine: missing or invalid status number in '" << buf->content() << "'"); + *error = HTTP_INVALID_HEADER; + return false; + } + return true; } diff -u -r -N squid-3.0.STABLE16/src/HttpReply.h squid-3.0.STABLE17/src/HttpReply.h --- squid-3.0.STABLE16/src/HttpReply.h 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/HttpReply.h 2009-07-27 00:24:46.000000000 +1200 @@ -66,9 +66,9 @@ //virtual void unlock(); // only needed for debugging // returns true on success - // returns false and sets *error to zero when needs more data + // returns false and leaves *error unchanged when needs more data // returns false and sets *error to a positive http_status code on error - virtual bool sanityCheckStartLine(MemBuf *buf, http_status *error); + virtual bool sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error); /* public, readable; never update these or their .hdr equivalents directly */ time_t date; diff -u -r -N squid-3.0.STABLE16/src/HttpRequest.cc squid-3.0.STABLE17/src/HttpRequest.cc --- squid-3.0.STABLE16/src/HttpRequest.cc 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/HttpRequest.cc 2009-07-27 00:24:46.000000000 +1200 @@ -142,17 +142,29 @@ init(); } +/** + * Checks the first line of an HTTP request is valid + * currently just checks the request method is present. + * + * NP: Other errors are left for detection later in the parse. + */ bool -HttpRequest::sanityCheckStartLine(MemBuf *buf, http_status *error) +HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) { - /* - * Just see if the request buffer starts with a known - * HTTP request method. NOTE this whole function is somewhat - * superfluous and could just go away. - */ + // content is long enough to possibly hold a reply + // 2 being magic size of a 1-byte request method plus space delimiter + if ( buf->contentSize() < 2 ) { + // this is ony a real error if the headers apparently complete. + if (hdr_len > 0) { + *error = HTTP_INVALID_HEADER; + } + return false; + } + /* See if the request buffer starts with a known HTTP request method. */ if (METHOD_NONE == HttpRequestMethod(buf->content())) { debugs(73, 3, "HttpRequest::sanityCheckStartLine: did not find HTTP request method"); + *error = HTTP_INVALID_HEADER; return false; } diff -u -r -N squid-3.0.STABLE16/src/HttpRequest.h squid-3.0.STABLE17/src/HttpRequest.h --- squid-3.0.STABLE16/src/HttpRequest.h 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/HttpRequest.h 2009-07-27 00:24:46.000000000 +1200 @@ -157,7 +157,7 @@ protected: virtual void packFirstLineInto(Packer * p, bool full_uri) const; - virtual bool sanityCheckStartLine(MemBuf *buf, http_status *error); + virtual bool sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error); virtual void hdrCacheInit(); diff -u -r -N squid-3.0.STABLE16/src/Makefile.am squid-3.0.STABLE17/src/Makefile.am --- squid-3.0.STABLE16/src/Makefile.am 2009-06-15 19:31:28.000000000 +1200 +++ squid-3.0.STABLE17/src/Makefile.am 2009-07-27 00:24:46.000000000 +1200 @@ -25,7 +25,7 @@ SNMP_SOURCE = endif -TESTS=$(check_PROGRAMS) +TESTS= check_PROGRAMS= SUBDIRS = fs repl auth @@ -1135,6 +1135,9 @@ tests/testURL \ @STORE_TESTS@ +## NP: required to run the above list. check_PROGRAMS only builds the binaries... +TESTS += $(check_PROGRAMS) + ### Template for new Unit Test Program ## - add tests/testX to check_PROGRAMS above. ## - copy template below and substitue X for class name diff -u -r -N squid-3.0.STABLE16/src/String.cc squid-3.0.STABLE17/src/String.cc --- squid-3.0.STABLE16/src/String.cc 2009-06-15 19:31:29.000000000 +1200 +++ squid-3.0.STABLE17/src/String.cc 2009-07-27 00:24:46.000000000 +1200 @@ -173,6 +173,7 @@ len_ += len; } else { String snew; + assert(len_ + len < 65536); // otherwise snew.len_ overflows below snew.len_ = len_ + len; snew.initBuf(snew.len_ + 1); diff -u -r -N squid-3.0.STABLE16/src/tests/stub_HttpReply.cc squid-3.0.STABLE17/src/tests/stub_HttpReply.cc --- squid-3.0.STABLE16/src/tests/stub_HttpReply.cc 2009-06-15 19:31:32.000000000 +1200 +++ squid-3.0.STABLE17/src/tests/stub_HttpReply.cc 2009-07-27 00:24:48.000000000 +1200 @@ -76,7 +76,7 @@ } bool -HttpReply::sanityCheckStartLine(MemBuf *buf, http_status *error) +HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) { fatal ("Not implemented"); return false; diff -u -r -N squid-3.0.STABLE16/src/tests/stub_HttpRequest.cc squid-3.0.STABLE17/src/tests/stub_HttpRequest.cc --- squid-3.0.STABLE16/src/tests/stub_HttpRequest.cc 2009-06-15 19:31:32.000000000 +1200 +++ squid-3.0.STABLE17/src/tests/stub_HttpRequest.cc 2009-07-27 00:24:48.000000000 +1200 @@ -56,7 +56,7 @@ } bool -HttpRequest::sanityCheckStartLine(MemBuf *buf, http_status *error) +HttpRequest::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) { fatal("Not implemented"); return false; diff -u -r -N squid-3.0.STABLE16/src/wccp2.cc squid-3.0.STABLE17/src/wccp2.cc --- squid-3.0.STABLE16/src/wccp2.cc 2009-06-15 19:31:33.000000000 +1200 +++ squid-3.0.STABLE17/src/wccp2.cc 2009-07-27 00:24:48.000000000 +1200 @@ -1183,7 +1183,9 @@ /* Go through the data structure */ while (data_length > offset) { - header = (struct wccp2_item_header_t *) &wccp2_i_see_you.data[offset]; + char *data = wccp2_i_see_you.data; + + header = (struct wccp2_item_header_t *) &data[offset]; switch (ntohs(header->type)) { @@ -1402,6 +1404,7 @@ for (num_caches = 0; num_caches < (int) ntohl(tmp); num_caches++) { /* Get a copy of the ip */ + memset(&cache_address, 0, sizeof(cache_address)); // Make GCC happy switch (Config.Wccp2.assignment_method) {