]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: http: fix buffer overflow on loguri buffer.
authorEmeric Brun <ebrun@haproxy.com>
Wed, 5 Jul 2017 11:33:16 +0000 (13:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Jul 2017 11:59:29 +0000 (13:59 +0200)
The pool used to log the uri was created with a size of 0 because the
configuration and 'tune.http.logurilen' were parsed too earlier.

The fix consist to postpone the pool_create as it is done for
cookie captures.

Regression introduced with 'MINOR: log: Add logurilen tunable'

src/cfgparse.c
src/proto_http.c

index 3706bca52736205125183bb107b4dd7100c886d2..600f2737d51f9f851f53c7eec0bbce304b7535be 100644 (file)
@@ -7404,6 +7404,8 @@ int check_config_validity()
        if (!global.tune.requri_len)
                global.tune.requri_len = REQURI_LEN;
 
+       pool2_requri = create_pool("requri", global.tune.requri_len , MEM_F_SHARED);
+
        pool2_capture = create_pool("capture", global.tune.cookie_len, MEM_F_SHARED);
 
        /* allocate pool of resolution per resolvers */
index 46cb6ffe22de0a81aa17ca41cde69be1d33db590..7141833b0d4982a27f2f9e40ee0d07a6dc3d3852 100644 (file)
@@ -459,7 +459,6 @@ void init_proto_http()
 
        /* memory allocations */
        pool2_http_txn = create_pool("http_txn", sizeof(struct http_txn), MEM_F_SHARED);
-       pool2_requri = create_pool("requri", global.tune.requri_len , MEM_F_SHARED);
        pool2_uniqueid = create_pool("uniqueid", UNIQUEID_LEN, MEM_F_SHARED);
 }