]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Sometimes I'm a dope. No need to allocate a bunch a space... we just
authorJim Jagielski <jim@apache.org>
Thu, 3 Oct 2002 20:51:53 +0000 (20:51 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 3 Oct 2002 20:51:53 +0000 (20:51 +0000)
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

src/main/http_protocol.c

index 3a73799fa719bca4f63bd6de78d658d295b1b081..04d0894719c69da0a356f66003f0a6f2b9e3333d 100644 (file)
@@ -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);