From: Vinson Lee Date: Fri, 20 Nov 2009 19:34:21 +0000 (-0800) Subject: progs/slang: Check for ftell failure in vstest.c. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c88b18a4df753205321ce1f7ddcd99244b670a1e;p=mesa.git progs/slang: Check for ftell failure in vstest.c. --- 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));