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

This commit is contained in:
Tobias Brunner
2016-03-11 15:23:18 +01:00
parent 8c3bcebaa6
commit b0c6869967
+1 -1
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]);