From: Bill Stoddard Date: Wed, 21 Aug 2002 13:33:07 +0000 (+0000) Subject: Win32: Fix one byte overflow in ap_get_win32_interpreter when the CGI script X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9649834846e637470228b0bcfc36623ccc91e6ce;p=thirdparty%2Fapache%2Fhttpd.git Win32: Fix one byte overflow in ap_get_win32_interpreter when the CGI script has no '\r' or '\n' in the first 1023 bytes. Reported by: Aaron Campbell git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@96464 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/main/http_core.c b/src/main/http_core.c index b557586eaaa..b993a55133a 100644 --- a/src/main/http_core.c +++ b/src/main/http_core.c @@ -1041,7 +1041,7 @@ API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r, if ((buffer[0] == '#') && (buffer[1] == '!')) { /* Assuming file is a script since it starts with a shebang */ fileType = eFileTypeSCRIPT; - for (i = 2; i < sizeof(buffer); i++) { + for (i = 2; i < (sizeof(buffer) - 1); i++) { if ((buffer[i] == '\r') || (buffer[i] == '\n')) { break;