imc-os: Terminate buffer after fread(3) call to make Coverity happy

This commit is contained in:
Tobias Brunner 2016-03-11 14:40:55 +01:00
parent 8c3bcebaa6
commit b0c6869967
1 changed files with 1 additions and 1 deletions

View File

@ -435,13 +435,13 @@ static bool extract_platform_info(os_type_t *type, chunk_t *name,
}
len = min(file_len, len);
rewind(file);
buf[len] = '\0';
if (fread(buf, 1, len, file) != len)
{
DBG1(DBG_IMC, "failed to read file \"%s\"", releases[i]);
fclose(file);
return FALSE;
}
buf[len] = '\0';
fclose(file);
DBG1(DBG_IMC, "processing \"%s\" file", releases[i]);