From f8283fcc895cd66d3483e4ab0099a8e0d36f6cb9 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sat, 12 Aug 2017 22:39:33 +0800 Subject: [PATCH] Fix #1626 --- src/jconf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jconf.c b/src/jconf.c index 05445c34..70b92f0d 100644 --- a/src/jconf.c +++ b/src/jconf.c @@ -163,6 +163,10 @@ read_jconf(const char *file) long pos = ftell(f); fseek(f, 0, SEEK_SET); + if (pos < 0) { + FATAL("Invalid config path."); + } + if (pos >= MAX_CONF_SIZE) { FATAL("Too large config file."); }