From f2e1b7d8683b46f9631b5f550605f396fcf21f65 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 9 Oct 2019 15:05:54 +0200 Subject: [PATCH] Add EOF checking in string reading Fixes rednex/#422 --- src/link/object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/link/object.c b/src/link/object.c index 3585f64e..7c04812c 100644 --- a/src/link/object.c +++ b/src/link/object.c @@ -127,6 +127,8 @@ static char *readstr(FILE *file) } /* Read char */ str[index] = getc(file); + if (str[index] == EOF) + return NULL; } while (str[index]); return str; }