]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mworker-prog: Fix segmentation fault during cfgparse
authorTim Duesterhus <tim@bastelstu.be>
Sun, 23 Jun 2019 20:10:12 +0000 (22:10 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 24 Jun 2019 08:09:00 +0000 (10:09 +0200)
commit2c9e274f45ddefbd5d4508cdc8957ee9c1acc75d
tree04dc45c8d3f8c3d2cf2b2502d5e24b8af0699998
parent3c55efb7dd0603023cc33bfce914073945140898
BUG/MINOR: mworker-prog: Fix segmentation fault during cfgparse

Consider this configuration:

    frontend fe_http
     mode http
     bind *:8080

     default_backend be_http

    backend be_http
     mode http
     server example example.com:80

    program foo bar

Running with valgrind results in:

    ==16252== Invalid read of size 8
    ==16252==    at 0x52AE3F: cfg_parse_program (mworker-prog.c:233)
    ==16252==    by 0x4823B3: readcfgfile (cfgparse.c:2180)
    ==16252==    by 0x47BCED: init (haproxy.c:1649)
    ==16252==    by 0x404E22: main (haproxy.c:2714)
    ==16252==  Address 0x48 is not stack'd, malloc'd or (recently) free'd

Check whether `ext_child` is valid before attempting to free it and its
contents.

This bug was introduced in 9a1ee7ac31c56fd7d881adf2ef4659f336e50c9f.
This fix must be backported to HAProxy 2.0.
src/mworker-prog.c