From c721ab05063d7330bb19a92716c5b288fb421188 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Thu, 25 May 2017 00:18:01 +0300 Subject: [PATCH] Always check for valid HTTP method before any modifications --- goodbyedpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/goodbyedpi.c b/goodbyedpi.c index 178eedb..d4f221c 100644 --- a/goodbyedpi.c +++ b/goodbyedpi.c @@ -273,7 +273,8 @@ int main(int argc, char *argv[]) { } /* Handle OUTBOUND packet, search for Host header */ else if (addr.Direction == WINDIVERT_DIRECTION_OUTBOUND && - packet_dataLen > 16 && ppTcpHdr->DstPort == htons(80) && + packet_dataLen > 16 && ppTcpHdr->DstPort == htons(80) && + find_http_method_end(packet_data) && (do_host || do_host_removespace)) { data_addr = find_host_header(packet_data, packet_dataLen);