From 07bdb6e289c7954e2a533039dc93c1c136099d2d Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 15 Dec 2012 02:02:23 +0100 Subject: [PATCH] [bdf] Fix Savannah bug #37906. * src/bdf/bdflib.c (_bdf_parse_glyphs): Use correct array size for checking `glyph_enc'. --- ChangeLog | 7 +++++++ src/bdf/bdflib.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c9e7eb9f..2cf618d47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-12-15 Werner Lemberg + + [bdf] Fix Savannah bug #37906. + + * src/bdf/bdflib.c (_bdf_parse_glyphs): Use correct array size for + checking `glyph_enc'. + 2012-12-15 Werner Lemberg [bdf] Fix Savannah bug #37905. diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c index 8d7f9a074..f9c06ca13 100644 --- a/src/bdf/bdflib.c +++ b/src/bdf/bdflib.c @@ -1628,8 +1628,9 @@ /* Check that the encoding is in the Unicode range because */ /* otherwise p->have (a bitmap with static size) overflows. */ - if ( p->glyph_enc > 0 && - (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 ) + if ( p->glyph_enc > 0 && + (size_t)p->glyph_enc >= sizeof ( p->have ) / + sizeof ( unsigned long ) * 32 ) { FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "ENCODING" )); error = BDF_Err_Invalid_File_Format;