]> git.ipfire.org Git - thirdparty/lxc.git/commit
rexec: Avoid invalid free in rexec failure path 4412/head
authorPetr Malat <oss@malat.biz>
Tue, 12 Mar 2024 12:28:29 +0000 (13:28 +0100)
committerPetr Malat <oss@malat.biz>
Tue, 19 Mar 2024 08:34:35 +0000 (09:34 +0100)
commit590a95d836324257cff63b8a3d275f772b9f9fc4
tree95a235c3874704394c4ff7f79a3e2c10c2b34cb2
parentf1a102400a5088c0d887af62c15fbb08d7bcef0c
rexec: Avoid invalid free in rexec failure path

Commit "rexec: free argv array on failure" used __do_free_string_list
as a destructor for argv, which is an array of pointers to a single
buffer and not an array of pointers to independent buffers, which leads
to an attempt to free invalid pointer whenever argv has more than one
element.

Structure argv as one memory block and use __do_free as the destructor.

Signed-off-by: Petr Malat <oss@malat.biz>
src/lxc/rexec.c