Phoenix-RTOS: Add checking EOF in getmntent().

This commit is contained in:
Kuba Sejdak 2016-06-24 14:14:51 +02:00 committed by Corinna Vinschen
parent cd169e629a
commit 0601c03109
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ struct mntent *getmntent_r(FILE *fp, struct mntent *result, char *buffer, int bu
buff_ptr = buffer;
if (getline(&line, &size, fp) == -1) {
if (getline(&line, &size, fp) == -1 || feof(fp)) {
free(line);
return NULL;
}