From c88b18a4df753205321ce1f7ddcd99244b670a1e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 11:34:21 -0800 Subject: [PATCH] progs/slang: Check for ftell failure in vstest.c. --- progs/slang/vstest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/progs/slang/vstest.c b/progs/slang/vstest.c index 472ea9b62e2..33c6f09dc55 100644 --- a/progs/slang/vstest.c +++ b/progs/slang/vstest.c @@ -220,6 +220,12 @@ static void load_test_file (const char *filename) fseek (f, 0, SEEK_END); size = ftell (f); + + if (size == -1) { + fclose (f); + return; + } + fseek (f, 0, SEEK_SET); code = (char *) (malloc (size)); -- 2.30.2