imc-os: Terminate buffer after fread(3) call to make Coverity happy
This commit is contained in:
@@ -435,13 +435,13 @@ static bool extract_platform_info(os_type_t *type, chunk_t *name,
|
|||||||
}
|
}
|
||||||
len = min(file_len, len);
|
len = min(file_len, len);
|
||||||
rewind(file);
|
rewind(file);
|
||||||
buf[len] = '\0';
|
|
||||||
if (fread(buf, 1, len, file) != len)
|
if (fread(buf, 1, len, file) != len)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, "failed to read file \"%s\"", releases[i]);
|
DBG1(DBG_IMC, "failed to read file \"%s\"", releases[i]);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
buf[len] = '\0';
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
DBG1(DBG_IMC, "processing \"%s\" file", releases[i]);
|
DBG1(DBG_IMC, "processing \"%s\" file", releases[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user