mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 13:48:33 -05:00
KWSys: SystemInformation: Add missing EOF check when reading /proc/cpuinfo
Backport KWSys upstream commit `6e847d08b` (SystemInformation: Add missing EOF check when reading /proc/cpuinfo, 2024-10-23) to the CMake 3.31 release branch.
This commit is contained in:
@@ -3405,8 +3405,9 @@ bool SystemInformationImplementation::RetrieveInformationFromCpuInfoFile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t fileSize = 0;
|
size_t fileSize = 0;
|
||||||
while (!feof(fd)) {
|
int fc;
|
||||||
buffer += static_cast<char>(fgetc(fd));
|
while ((fc = fgetc(fd)) != EOF) {
|
||||||
|
buffer += static_cast<char>(fc);
|
||||||
fileSize++;
|
fileSize++;
|
||||||
}
|
}
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user