]> Git Repo - qemu.git/commit
block: Don't copy backing file name on error
authorMax Reitz <[email protected]>
Sat, 26 Oct 2013 13:44:43 +0000 (15:44 +0200)
committerKevin Wolf <[email protected]>
Mon, 28 Oct 2013 16:35:52 +0000 (17:35 +0100)
commit61ed2684539f7f31304e193d7c0e68d57ce6be88
tree611df1028c679cdfc23e4d40dd8acf918c05ae6e
parentd1f3a23bfac4fe38056ab5e07186939b7be8852b
block: Don't copy backing file name on error

bdrv_open_backing_file() tries to copy the backing file name using
pstrcpy directly after calling bdrv_open() to open the backing file
without checking whether that was actually successful. If it was not,
ps->backing_hd->file will probably be NULL and qemu will crash.

Fix this by moving pstrcpy after checking whether bdrv_open() succeeded.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Benoit Canet <[email protected]>
Reviewed-by: Amos Kong <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block.c
This page took 0.023326 seconds and 4 git commands to generate.