[type42] Fix Savannah bug #35602.

* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
thoroughly.
This commit is contained in:
Werner Lemberg 2012-02-25 13:22:40 +01:00
parent 0b1c0c6b20
commit 82365c0dea
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2012-02-25 Werner Lemberg <wl@gnu.org>
[type42] Fix Savannah bug #35602.
* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
thoroughly.
2012-02-25 Werner Lemberg <wl@gnu.org>
[bdf] Fix Savannah bugs #35599 and #35600.

View File

@ -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 )