mirror of
https://github.com/mii443/qemu.git
synced 2025-12-12 05:18:37 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user