]> git.ipfire.org Git - thirdparty/qemu.git/commit
9pfs: fix potential segfault during walk
authorGreg Kurz <groug@kaod.org>
Fri, 16 Sep 2016 09:44:49 +0000 (11:44 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 2 Nov 2016 21:41:34 +0000 (16:41 -0500)
commitd06c61f31001474a73b7fcc7a2c2067ed3f489d4
treeca7e504013cb798725ef3dd29dc75e920b031d21
parent91a2f462976aff1206e06271536422314d6d9348
9pfs: fix potential segfault during walk

If the call to fid_to_qid() returns an error, we will call v9fs_path_free()
on uninitialized paths.

It is a regression introduced by the following commit:

56f101ecce0e 9pfs: handle walk of ".." in the root directory

Let's fix this by initializing dpath and path before calling fid_to_qid().

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
[groug: updated the changelog to indicate this is regression and to provide
        the offending commit SHA1]
Signed-off-by: Greg Kurz <groug@kaod.org>
(cherry picked from commit 13fd08e631ec0c3ff5ad1bdcb6a4474c7d9a024f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/9pfs/9p.c