From bb44619b06c0bef20b658ff532cf850c16362ae7 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 15 Mar 2013 10:35:06 +0100 Subject: blockdev: Keep a copy of DriveInfo.serial Pointing to a QemuOpts element is surprising and can lead to subtle use-after-free errors when the QemuOpts is freed after all options are parsed. Signed-off-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- include/sysemu/blockdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 1fe5332..804ec88 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -40,7 +40,7 @@ struct DriveInfo { int media_cd; int cyls, heads, secs, trans; QemuOpts *opts; - const char *serial; + char *serial; QTAILQ_ENTRY(DriveInfo) next; int refcount; }; -- cgit v1.1