From a828cb1a5c0835d08a17c86f64d571436f93f980 Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 10 Dec 2014 00:58:36 +0100 Subject: backends: Fix several security issues in the dvi-backend. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See CVE-2010-2640, CVE-2010-2641, CVE-2010-2642 and CVE-2010-2643. Taken from evince commit: d4139205b010ed06310d14284e63114e88ec6de2 From: José Aliste --- backend/dvi/mdvi-lib/tfmfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/dvi/mdvi-lib/tfmfile.c') diff --git a/backend/dvi/mdvi-lib/tfmfile.c b/backend/dvi/mdvi-lib/tfmfile.c index 73ebf26a..8c2a30b2 100644 --- a/backend/dvi/mdvi-lib/tfmfile.c +++ b/backend/dvi/mdvi-lib/tfmfile.c @@ -172,7 +172,8 @@ int tfm_load_file(const char *filename, TFMInfo *info) /* We read the entire TFM file into core */ if(fstat(fileno(in), &st) < 0) return -1; - if(st.st_size == 0) + /* according to the spec, TFM files are smaller than 16K */ + if(st.st_size == 0 || st.st_size >= 16384) goto bad_tfm; /* allocate a word-aligned buffer to hold the file */ -- cgit v1.2.1