]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
return ICP_ERR for ICP queries which have whitespace in URLs
authorwessels <>
Tue, 18 Aug 1998 22:00:22 +0000 (22:00 +0000)
committerwessels <>
Tue, 18 Aug 1998 22:00:22 +0000 (22:00 +0000)
src/icp_v2.cc
src/icp_v3.cc

index 84fc70e4f71c0b3e7cb029d297cf3932f549774b..36c29f9f388d0b1a185a7eb26a1c6ecec758169f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icp_v2.cc,v 1.47 1998/08/14 19:25:21 wessels Exp $
+ * $Id: icp_v2.cc,v 1.48 1998/08/18 16:00:22 wessels Exp $
  *
  * DEBUG: section 12    Internet Cache Protocol
  * AUTHOR: Duane Wessels
@@ -211,6 +211,12 @@ icpHandleIcpV2(int fd, struct sockaddr_in from, char *buf, int len)
     case ICP_QUERY:
        /* We have a valid packet */
        url = buf + sizeof(icp_common_t) + sizeof(u_num32);
+       if (strpbrk(url, w_space)) {
+           url = rfc1738_escape(url);
+           reply = icpCreateMessage(ICP_ERR, 0, url, header.reqnum, 0);
+           icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, 0);
+           break;
+       }
        if ((icp_request = urlParse(method, url)) == NULL) {
            reply = icpCreateMessage(ICP_ERR, 0, url, header.reqnum, 0);
            icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, 0);
index c721f330aad26b78b8d1620679637492809336a3..cf662b71c0ffb6d41c53f43e2b5a0c45192b9f24 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icp_v3.cc,v 1.23 1998/08/14 19:25:22 wessels Exp $
+ * $Id: icp_v3.cc,v 1.24 1998/08/18 16:00:24 wessels Exp $
  *
  * DEBUG: section 12    Internet Cache Protocol
  * AUTHOR: Duane Wessels
@@ -65,6 +65,12 @@ icpHandleIcpV3(int fd, struct sockaddr_in from, char *buf, int len)
     case ICP_QUERY:
        /* We have a valid packet */
        url = buf + sizeof(icp_common_t) + sizeof(u_num32);
+       if (strpbrk(url, w_space)) {
+           url = rfc1738_escape(url);
+           reply = icpCreateMessage(ICP_ERR, 0, url, header.reqnum, 0);
+           icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, 0);
+           break;
+       }
        if ((icp_request = urlParse(method, url)) == NULL) {
            reply = icpCreateMessage(ICP_ERR, 0, url, header.reqnum, 0);
            icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, 0);