[type42] Fix memory leak (#45989). * src/type42/t42parse.c (t42_parse_charstrings): Allow only a single `CharStrings' array.
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
diff --git a/ChangeLog b/ChangeLog
index 6e90f76..511c8cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2015-09-17 Werner Lemberg <wl@gnu.org>
+ [type42] Fix memory leak (#45989).
+
+ * src/type42/t42parse.c (t42_parse_charstrings): Allow only a single
+ `CharStrings' array.
+
+2015-09-17 Werner Lemberg <wl@gnu.org>
+
[psaux] Fix memory leak (#45986).
* src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index ee77d86..003b63e 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -841,6 +841,15 @@
/* initialize tables */
+ /* contrary to Type1, we disallow multiple CharStrings arrays */
+ if ( swap_table->init )
+ {
+ FT_ERROR(( "t42_parse_charstrings:"
+ " only one CharStrings array allowed\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Fail;
+ }
+
error = psaux->ps_table_funcs->init( code_table,
loader->num_glyphs,
memory );