Commit 1937b557341187eda5434a8a64da9880472c4cd4

Werner Lemberg 2018-08-14T07:54:25

[cff] Fix missing error handling. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9865 * src/psaux/cffparse.c (cff_parser_run) [CFF_CONFIG_OPTION_OLD_ENGINE]: Don't ignore return value of `parse_charstrings_old'.

diff --git a/ChangeLog b/ChangeLog
index dddbe2c..2f373dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-08-14  Werner Lemberg  <wl@gnu.org>
+
+	[cff] Fix missing error handling.
+
+	Reported as
+
+	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9865
+
+	* src/psaux/cffparse.c (cff_parser_run)
+	[CFF_CONFIG_OPTION_OLD_ENGINE]: Don't ignore return value of
+	`parse_charstrings_old'.
+
 2018-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[bdf] Remove unused overflow storage.
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index b6f5dae..4b2ecc5 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -1231,6 +1231,8 @@
 
         error = psaux->cff_decoder_funcs->parse_charstrings_old(
                   &decoder, charstring_base, charstring_len, 1 );
+        if ( error )
+          goto Exit;
 
         /* Now copy the stack data in the temporary decoder object,    */
         /* converting it back to charstring number representations     */