bytes = fread (cpuinfo, 1, sizeof (cpuinfo), infofile);
fclose (infofile);
if (0 == bytes || CPUINFO_BUFFER_SIZE == bytes)
{
fprintf (stderr, "ERROR: Couldn't read the file \"/proc/cpuinfo\". NE10_init() failed.\n");
return NE10_ERR;
}
Hello developer,
Recently, I found a crash that occurs on some devices.
After some investigation, the evidence reveals a potentially fragile check shown above.
If the CPU info read from the file is larger than expected and reaches CPUINFO_BUFFER_SIZE, the initialization fails.
Would it be possible to change this check, or allocate a slightly larger buffer, for example CPUINFO_BUFFER_SIZE + 1?
Hello developer,
Recently, I found a crash that occurs on some devices.
After some investigation, the evidence reveals a potentially fragile check shown above.
If the CPU info read from the file is larger than expected and reaches CPUINFO_BUFFER_SIZE, the initialization fails.
Would it be possible to change this check, or allocate a slightly larger buffer, for example CPUINFO_BUFFER_SIZE + 1?