diff options
author | Cédric Le Goater <clg@redhat.com> | 2023-10-26 09:06:34 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2023-11-03 09:20:31 +0100 |
commit | 721da0396cfa0a4859cefb57e32cc79d19d80f54 (patch) | |
tree | 567f65bca8df6e5006bf9d3376d0411717fc5739 /hw/core | |
parent | ba7d12eb8ce2d7367615071c0569947457d36803 (diff) |
util/uuid: Add UUID_STR_LEN definition
qemu_uuid_unparse() includes a trailing NUL when writing the uuid
string and the buffer size should be UUID_FMT_LEN + 1 bytes. Add a
define for this size and use it where required.
Cc: Fam Zheng <fam@euphon.net>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: "Denis V. Lunev" <den@openvz.org>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/qdev-properties-system.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index b5ccafa29e..b46d16cd2c 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -1114,7 +1114,7 @@ static void get_uuid(Object *obj, Visitor *v, const char *name, void *opaque, { Property *prop = opaque; QemuUUID *uuid = object_field_prop_ptr(obj, prop); - char buffer[UUID_FMT_LEN + 1]; + char buffer[UUID_STR_LEN]; char *p = buffer; qemu_uuid_unparse(uuid, buffer); |