paivana

HTTP paywall reverse proxy
Log | Files | Refs | Submodules | README | LICENSE

commit 33e36b26edb3b057c833b93b92c094a6e37e7f88
parent 5f4ec315e3914ea2155f6ce4f4284d1bef67efe7
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  4 Aug 2026 17:07:25 +0200

make hdr parsing more robust

Diffstat:
Msrc/tests/pipeline_client.c | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/tests/pipeline_client.c b/src/tests/pipeline_client.c @@ -243,11 +243,13 @@ header_content_length (const char *buf, */ static int header_status (const char *buf, - size_t start) + size_t start, + size_t hdr_end) { const char *p = buf + start; - const char *sp = strchr (p, - ' '); + const char *sp = memchr (p, + ' ', + hdr_end - start); if (NULL == sp) return -1; @@ -343,7 +345,8 @@ main (int argc, char **argv) break; } status = header_status (buf, - pos); + pos, + hdr_end); cl = header_content_length (buf, pos, hdr_end);