mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
qom: fix off-by-one
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
7b7b7d18e4
commit
8f770d3905
1 changed files with 2 additions and 5 deletions
|
@ -854,11 +854,8 @@ static void object_set_link_property(Object *obj, Visitor *v, void *opaque,
|
|||
|
||||
target = object_resolve_path(path, &ambiguous);
|
||||
if (target) {
|
||||
gchar *target_type;
|
||||
|
||||
target_type = g_strdup(&type[5]);
|
||||
target_type[strlen(target_type) - 2] = 0;
|
||||
|
||||
/* Go from link<FOO> to FOO. */
|
||||
gchar *target_type = g_strndup(&type[5], strlen(type) - 6);
|
||||
if (object_dynamic_cast(target, target_type)) {
|
||||
object_ref(target);
|
||||
*child = target;
|
||||
|
|
Loading…
Reference in a new issue