diff --git a/src/util/uuid.c b/src/util/uuid.c index f18814885e..9cafc2ada1 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -286,7 +286,8 @@ virSetHostUUIDStr(const char *uuid) return EEXIST; if (!uuid) { - if (!getDMISystemUUID(dmiuuid, sizeof(dmiuuid))) { + memset(dmiuuid, 0, sizeof(dmiuuid)); + if (!getDMISystemUUID(dmiuuid, sizeof(dmiuuid) - 1)) { if (!virUUIDParse(dmiuuid, host_uuid)) return 0; }