From 37b5177b061a0696bec831bd1207b70dd2258715 Mon Sep 17 00:00:00 2001 From: mrg Date: Fri, 7 Mar 2008 18:20:20 +0000 Subject: [PATCH] fix a problem in %xy decoding. --- libexec/httpd/bozohttpd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c index 4d2e567eb2c4..a65977d733c3 100644 --- a/libexec/httpd/bozohttpd.c +++ b/libexec/httpd/bozohttpd.c @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.c,v 1.6 2008/03/03 22:15:08 mrg Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.7 2008/03/07 18:20:20 mrg Exp $ */ /* $eterna: bozohttpd.c,v 1.142 2008/03/03 03:36:11 mrg Exp $ */ @@ -1450,12 +1450,12 @@ fix_url_percent(http_req *request) buf[2] = '\0'; s++; *t = (char)strtol(buf, NULL, 16); - debug((DEBUG_EXPLODING, "fu_%%: strtol put %c into *t", *t)); + debug((DEBUG_EXPLODING, "fu_%%: strtol put '%c' into *t", *t)); if (*t++ == '\0') http_error(400, request, "percent hack got a 0 back"); while (*s && *s != '%') { - if (s >= end) + if (end && s >= end) break; *t++ = *s++; }