]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: ssl/cli: restore the store conf on "add ssl crt-list" error
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 25 Nov 2026 16:47:42 +0000 (17:47 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 25 Nov 2026 16:37:36 +0000 (17:37 +0100)
commit29225103f3977f2c9c4708ed3ce7e9805b41fba5
treeec3f439be76463f5617c45ef3d1a85910107d609
parent3789c8e2718e6cca4be44aba801318cb31f8042f
BUG/MEDIUM: ssl/cli: restore the store conf on "add ssl crt-list" error

In cli_parse_add_crtlist(), a store without any instance adopts the
ckch_conf parsed from the line, but if the line is rejected afterwards,
the error path frees the content of that conf, and the store keeps
pointers to freed strings. They are then printed by "show ssl cert" and
freed again by "del ssl cert". It can be triggered by adding a
certificate created with "new ssl cert" to a crt-list which is a
directory, using crt-store keywords such as "key" or "issuer".

Let's save the previous conf of the store and restore it on error, so
that a rejected line doesn't change the store. This was introduced by
commit 1bc6e990f ("MEDIUM: ssl/cli: handle crt-store keywords in crt-list
over the CLI") in 3.0-dev12, so this should be backported to 3.0.
src/ssl_crtlist.c