]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] fix parser crash on unconditional tcp content rules
authorWilly Tarreau <w@1wt.eu>
Sun, 10 May 2009 10:05:46 +0000 (12:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 May 2009 10:22:39 +0000 (12:22 +0200)
Since 1.3.17, a config containing one of the following lines would
crash the parser :

    tcp content reject
    tcp content accept

This is because a check is performed on the condition which is not
specified. The obvious fix consists in checkinf for a condition
first.

src/proto_tcp.c

index 8c1ae222ed913bef3f4be9594f74135b38b8bbe4..4d0ae35596d875b25cd81b2d06db06fb87607b02 100644 (file)
@@ -521,7 +521,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
 
                // FIXME: how to set this ?
                // cond->line = linenum;
-               if (cond->requires & (ACL_USE_RTR_ANY | ACL_USE_L7_ANY)) {
+               if (cond && cond->requires & (ACL_USE_RTR_ANY | ACL_USE_L7_ANY)) {
                        struct acl *acl;
                        const char *name;