From: wessels <> Date: Tue, 18 Aug 1998 22:00:22 +0000 (+0000) Subject: return ICP_ERR for ICP queries which have whitespace in URLs X-Git-Tag: SQUID_3_0_PRE1~2858 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a02d20d9915acd7a6b7a6ba9f934124254e62212;p=thirdparty%2Fsquid.git return ICP_ERR for ICP queries which have whitespace in URLs --- diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 84fc70e4f7..36c29f9f38 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -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); diff --git a/src/icp_v3.cc b/src/icp_v3.cc index c721f330aa..cf662b71c0 100644 --- a/src/icp_v3.cc +++ b/src/icp_v3.cc @@ -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);