From: wessels <> Date: Fri, 13 Apr 2007 23:04:00 +0000 (+0000) Subject: The return value of comm_udp_recvfrom() must be stored into a signed X-Git-Tag: SQUID_3_0_PRE6~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b6d19558b82684fe3edcde47e473b534b182fc0;p=thirdparty%2Fsquid.git The return value of comm_udp_recvfrom() must be stored into a signed integer, otherwise we cannot check for errors when len < 0. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index e7d88238eb..65c1f76f33 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.95 2007/04/10 17:42:43 rousskov Exp $ + * $Id: dns_internal.cc,v 1.96 2007/04/13 17:04:00 wessels Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -993,7 +993,7 @@ static void idnsRead(int fd, void *data) { int *N = &incoming_sockets_accepted; - ssize_t len; + int len; struct sockaddr_in from; socklen_t from_len; diff --git a/src/icp_v2.cc b/src/icp_v2.cc index f0a0abce37..17ebf47509 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.cc,v 1.94 2006/08/19 12:31:21 robertc Exp $ + * $Id: icp_v2.cc,v 1.95 2007/04/13 17:04:00 wessels Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -600,7 +600,7 @@ icpHandleUdp(int sock, void *data) struct sockaddr_in from; socklen_t from_len; LOCAL_ARRAY(char, buf, SQUID_UDP_SO_RCVBUF); - size_t len; + int len; int icp_version; int max = INCOMING_ICP_MAX; commSetSelect(sock, COMM_SELECT_READ, icpHandleUdp, NULL, 0); @@ -649,7 +649,7 @@ icpHandleUdp(int sock, void *data) icpPktDump(buf); #endif - if (len < sizeof(icp_common_t)) { + if ((size_t) len < sizeof(icp_common_t)) { debug(12, 4) ("icpHandleUdp: Ignoring too-small UDP packet\n"); break; }