From 82365c0dead99dd119d9e7117cf4f36ce1d1cbe1 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 25 Feb 2012 13:22:40 +0100 Subject: [PATCH] [type42] Fix Savannah bug #35602. * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more thoroughly. --- ChangeLog | 7 +++++++ src/type42/t42parse.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98df50862..5bca0875e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-25 Werner Lemberg + + [type42] Fix Savannah bug #35602. + + * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more + thoroughly. + 2012-02-25 Werner Lemberg [bdf] Fix Savannah bugs #35599 and #35600. diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c index 976aa2273..f2408cdfe 100644 --- a/src/type42/t42parse.c +++ b/src/type42/t42parse.c @@ -4,7 +4,7 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002-2011 by */ +/* Copyright 2002-2012 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -608,7 +608,8 @@ } /* A string can have a trailing zero byte for padding. Ignore it. */ - if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) + if ( string_size && + string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) string_size--; if ( !string_size )