Fixes: https://github.com/alsa-project/alsa-lib/pull/238
Signed-off-by: Tomohiro IKEDA <rilakkuma.san.xjapan@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
/* try to determine the capabilities of the CPU */
in = fopen("/proc/cpuinfo", "r");
if (in) {
- while (!feof(in)) {
- fgets(line, sizeof(line), in);
+ while (!feof(in) && (fgets(line, sizeof(line), in) != NULL)) {
if (!strncmp(line, "processor", 9))
smp++;
else if (!strncmp(line, "flags", 5)) {
/* try to determine, if we have SMP */
in = fopen("/proc/cpuinfo", "r");
if (in) {
- while (!feof(in)) {
- fgets(line, sizeof(line), in);
+ while (!feof(in) && (fgets(line, sizeof(line), in) != NULL)) {
if (!strncmp(line, "processor", 9))
smp++;
}