]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] config: don't crash on empty pattern files.
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Mar 2011 06:27:02 +0000 (07:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Mar 2011 09:22:30 +0000 (10:22 +0100)
commitdfd7fca26c6f0718ddc319433a4a0bc8f154a487
tree40518a61d6a2129c1f62c57f5231e2c94ee988e6
parent1e2a170cf8da3a16a3fcab0742a2cf2a462b7aa8
[BUG] config: don't crash on empty pattern files.

Both Hank A. Paulson and Rob at pixsense reported a crash when
loading ACLs from a pattern file which contains empty lines.

From the tests, it appears that only files that contain nothing
but empty lines are causing that (in the past they would have had
their line feeds loaded as patterns).

The crash happens in the free_pattern() call which doesn't like to
be called with a NULL pattern. Let's make it accept it so that it's
more in line with the standard uses of free() which ignores NULLs.
src/acl.c