From 0b6d19558b82684fe3edcde47e473b534b182fc0 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Fri, 13 Apr 2007 23:04:00 +0000 Subject: [PATCH] The return value of comm_udp_recvfrom() must be stored into a signed integer, otherwise we cannot check for errors when len < 0. --- src/dns_internal.cc | 4 ++-- src/icp_v2.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.47.2