]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
The return value of comm_udp_recvfrom() must be stored into a signed
authorwessels <>
Fri, 13 Apr 2007 23:04:00 +0000 (23:04 +0000)
committerwessels <>
Fri, 13 Apr 2007 23:04:00 +0000 (23:04 +0000)
integer, otherwise we cannot check for errors when len < 0.

src/dns_internal.cc
src/icp_v2.cc

index e7d88238ebdc51157009ec90cf85ffbe89769665..65c1f76f330d995200e133c41f238b244c39984f 100644 (file)
@@ -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;
index f0a0abce37a3d9a627d6ba958cbad22b193d3f43..17ebf475094d6847ec82b0106a8e847510619cf5 100644 (file)
@@ -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;
         }