]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ring: fix creation of server in uninitialized ring
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Nov 2022 17:56:34 +0000 (18:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Nov 2022 17:59:43 +0000 (18:59 +0100)
commit1b662aabbfa32fb6ddeff4ff5f0e3031f12dafd3
treed7416cebeca136c15aad25beea88b83f219ba900
parent9fd0542148d8e02f1a81948f9e8689ea7d2d9533
BUG/MEDIUM: ring: fix creation of server in uninitialized ring

If a "ring" section initialization fails (e.g. due to a duplicate name,
invalid chars, or missing memory), any subsequent "server" statement that
appears in the same section will crash the config parser by dereferencing
the currently NULL cfg_sink. E.g:

    ring x
    ring x                 # fails on "already exists"
       server srv 1.1.1.1  # crashes on cfg_sink==NULL

All other statements have a test for this but "server" was missing it,
so this patch adds it.

Thanks to Joel Hutchinson for reporting this issue.

This must be backported as far as 2.2.
src/sink.c