From: Jim Jagielski Date: Thu, 3 Oct 2002 20:51:53 +0000 (+0000) Subject: Sometimes I'm a dope. No need to allocate a bunch a space... we just X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2a3467244590a7d4c405608bd831aaabcd2ce40;p=thirdparty%2Fapache%2Fhttpd.git Sometimes I'm a dope. No need to allocate a bunch a space... we just want to see if there's any whitespace past the number. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@97094 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/main/http_protocol.c b/src/main/http_protocol.c index 3a73799fa71..04d0894719c 100644 --- a/src/main/http_protocol.c +++ b/src/main/http_protocol.c @@ -1072,10 +1072,9 @@ static int read_request_line(request_rec *r) r->proto_num = HTTP_VERSION(r->protocol[5] - '0', r->protocol[7] - '0'); } else { - char *lint; + char lint[2]; char http[5]; - lint = ap_palloc(r->pool, strlen(r->protocol)+1); - if (3 == sscanf(r->protocol, "%4s/%u.%u%s", http, &major, &minor, lint) + if (3 == sscanf(r->protocol, "%4s/%u.%u%1s", http, &major, &minor, lint) && (strcasecmp("http", http) == 0) && (minor < HTTP_VERSION(1,0)) ) /* don't allow HTTP/0.1000 */ r->proto_num = HTTP_VERSION(major, minor);