]> xenbits.xensource.com Git - mini-os.git/commit
Mini-OS: fix 9pfs frontend error path
authorJuergen Gross <jgross@suse.com>
Wed, 7 Feb 2024 12:52:13 +0000 (13:52 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 7 Feb 2024 12:52:13 +0000 (13:52 +0100)
commitb119f0178fd86876d0678007dfcf435ab8bb7568
treeb8534961c046e1153dce5c2acec82945eba6a69d
parent51ecb456b133d82ac44b3774a47202cea0d1842e
Mini-OS: fix 9pfs frontend error path

The early error exit in p9_stat() returns without zeroing the p9_stat
buffer, resulting in free() being called with an uninitialized pointer.

Fix that by calling free_stat() in p9_stat() in case of returning an
error and potentially having allocated strings.

Reported-by: Julien Grall <julien@xen.org>
Fixes: 2d1dfccd3aa3 ("Mini-OS: add read and write support to 9pfsfront")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9pfront.c