From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYKKG-0006MQ-9o for qemu-devel@nongnu.org; Thu, 10 Apr 2014 15:07:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYKKB-00043h-E3 for qemu-devel@nongnu.org; Thu, 10 Apr 2014 15:07:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYKKB-00043Z-6F for qemu-devel@nongnu.org; Thu, 10 Apr 2014 15:07:47 -0400 Message-ID: <1397156890.28469.44.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Thu, 10 Apr 2014 22:08:10 +0300 In-Reply-To: <2f8f007ce2152ac3b65f0811199662799c509225.1397155389.git.crobinso@redhat.com> References: <2f8f007ce2152ac3b65f0811199662799c509225.1397155389.git.crobinso@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.0] qom: Fix crash with qom-list and link properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cole Robinson Cc: Marcin =?UTF-8?Q?Gibu=C5=82a?= , qemu-devel@nongnu.org, Stefan Hajnoczi , Andreas =?ISO-8859-1?Q?F=E4rber?= On Thu, 2014-04-10 at 14:47 -0400, Cole Robinson wrote: > Commit 9561fda8d90e176bef598ba87c42a1bd6ad03ef7 changed the type of > 'opaque' for link properties, but missed updating this call site. > Reproducer: >=20 > ./x86_64-softmmu/qemu-system-x86_64 -qmp unix:./qmp.sock,server & > ./scripts/qmp/qmp-shell ./qmp.sock > (QEMU) qom-list path=3D//machine/i440fx/pci.0/child[2] >=20 > Reported-by: Marcin Gibu=C5=82a > Signed-off-by: Cole Robinson > --- > qom/object.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/qom/object.c b/qom/object.c > index f4de619..9a730e7 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -1225,7 +1225,8 @@ Object *object_resolve_path_component(Object *par= ent, const gchar *part) > } > =20 > if (object_property_is_link(prop)) { > - return *(Object **)prop->opaque; > + LinkProperty *lprop =3D prop->opaque; > + return *lprop->child; Reviewed-by: Marcel Apfelbaum You may want another review from maintainers :), but I think the fix is fine. Thanks, Marcel > } else if (object_property_is_child(prop)) { > return prop->opaque; > } else {