]> granicus.if.org Git - ipset/commit
Fix use-after-free in ipset_parse_name_compat()
authorStefano Brivio <sbrivio@redhat.com>
Wed, 22 Aug 2018 09:22:53 +0000 (11:22 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 27 Aug 2018 11:40:09 +0000 (13:40 +0200)
commit623f05ed26bd7b3580954a2b495047ae976d360b
treed5aaaf1d78a026aad5ffa389488e7b7dc353c8cf
parenta758a6cdb3f5fbb81ab1b9aa7ffbbc0f7940f10e
Fix use-after-free in ipset_parse_name_compat()

When check_setname is used in ipset_parse_name_compat(), the
'str' and 'saved' macro arguments point in fact to the same
buffer. Free the 'saved' argument only after using it.

While at it, remove a useless NULL check on 'saved'.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
lib/parse.c