[type42] Fix Savannah bug #35602. * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more thoroughly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/ChangeLog b/ChangeLog
index 98df508..5bca087 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
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.
* src/bdf/bdflib.c (ACMSG16): New warning message.
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 976aa22..f2408cd 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 )