libuuid: (test) make sure UUID is terminated [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1104/head
Karel Zak 2020-07-14 12:15:47 +02:00
parent 59ba65df21
commit fc701415c4
1 changed files with 1 additions and 2 deletions

View File

@ -76,8 +76,7 @@ static int check_uuids_in_file(const char *file)
return 1;
}
while ((sz = read(fd, str, sizeof(str))) != 0) {
if (isspace(str[sizeof(str) - 1]))
str[sizeof(str) - 1] = '\0';
str[sizeof(str) - 1] = '\0';
if (uuid_parse(str, uuidBits)) {
warnx("%s: %s", file, str);
ret++;