From 82e5229df00859eb3500f0c771a8991d1fe8e607 Mon Sep 17 00:00:00 2001 From: ruti <> Date: Fri, 1 Mar 2024 01:27:04 +0300 Subject: [PATCH] Fix http parser --- packets.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packets.c b/packets.c index 6df8c84..ab1b095 100644 --- a/packets.c +++ b/packets.c @@ -177,8 +177,11 @@ int parse_http(char *buffer, size_t bsize, char **hs, uint16_t *port) h_end = 0; do { h = memchr(h, ':', l_end - h); - if (h) h_end = h; - } while (h); + if (h) { + h_end = h; + h++; + } + } while (h && h < l_end); } if (!h_end) {