]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http: fix the http-request capture parser
authorWilly Tarreau <w@1wt.eu>
Fri, 8 May 2015 14:13:42 +0000 (16:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 May 2015 14:13:42 +0000 (16:13 +0200)
Due to the code being mostly inspired from the tcp-request parser, it
does some crap because both don't work the same way. The "len" argument
could be mismatched and then the length could be used uninitialized.

src/proto_http.c

index 275f3290067293344c50dc8377fe92b39175e48a..957640ecef9a406518da3aa6bf5397fd080c6e9c 100644 (file)
@@ -12163,7 +12163,7 @@ int parse_http_req_capture(const char **args, int *orig_arg, struct proxy *px, s
        struct sample_expr *expr;
        struct cap_hdr *hdr;
        int cur_arg;
-       int len;
+       int len = 0;
 
        for (cur_arg = *orig_arg; cur_arg < *orig_arg + 3 && *args[cur_arg]; cur_arg++)
                if (strcmp(args[cur_arg], "if") == 0 ||