mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qom: Add error handler for object alias property
object_property_add_alias() is called at some places at present. And its parameter errp may not NULL, such as object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev),"iothread", &error_abort); This patch add error handler for security. Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
3a53009fa0
commit
8ae9a9ef4e
1 changed files with 8 additions and 1 deletions
|
@ -1642,6 +1642,7 @@ void object_property_add_alias(Object *obj, const char *name,
|
|||
ObjectProperty *op;
|
||||
ObjectProperty *target_prop;
|
||||
gchar *prop_type;
|
||||
Error *local_err = NULL;
|
||||
|
||||
target_prop = object_property_find(target_obj, target_name, errp);
|
||||
if (!target_prop) {
|
||||
|
@ -1663,9 +1664,15 @@ void object_property_add_alias(Object *obj, const char *name,
|
|||
property_get_alias,
|
||||
property_set_alias,
|
||||
property_release_alias,
|
||||
prop, errp);
|
||||
prop, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
g_free(prop);
|
||||
goto out;
|
||||
}
|
||||
op->resolve = property_resolve_alias;
|
||||
|
||||
out:
|
||||
g_free(prop_type);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue