summaryrefslogtreecommitdiff
path: root/backend/dvi/mdvi-lib/tfmfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/dvi/mdvi-lib/tfmfile.c')
-rw-r--r--backend/dvi/mdvi-lib/tfmfile.c3
1 files changed, 2 insertions, 1 deletions
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 */