freetype (2.4.2-2.1+squeeze4) CVE-2011-0226.patch

Summary

 src/psaux/t1decode.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

    
download this patch

Patch contents

commit c46b1e2476cc1804c0dd25d463be3c99d58befd7
Author: Werner Lemberg <wl@gnu.org>
Date:   Fri Jul 8 13:46:42 2011 +0200

    [psaux] Add better argument check for `callothersubr'.
    
    * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
    <op_callothersubr>: Reject negative arguments.

commit dc33b4a1555c184b83a402dfa1856b213e6b4fbd
Author: Алексей Подтележников <apodtele@gmail.com>
Date:   Sun Jul 10 07:08:51 2011 +0200

    [psaux] Optimize previous commit.
    
    * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
    <op_callothersubr>: Move error check down to avoid testing twice for
    good cases.

commit 60f8371353013e78ab0a789f49af90d64fe65f0d
Author: Werner Lemberg <wl@gnu.org>
Date:   Thu Jul 14 07:34:12 2011 +0200

    * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
    <op_callothersubr>: Better handling of subroutine index 0.
    From Matthias Drochner <M.Drochner@fz-juelich.de>.

diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index ea31c51..7ed031e 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -1009,11 +1009,14 @@
           break;
 
         default:
-          FT_ERROR(( "t1_decoder_parse_charstrings:"
-                     " unknown othersubr [%d %d], wish me luck\n",
-                     arg_cnt, subr_no ));
-          unknown_othersubr_result_cnt = arg_cnt;
-          break;
+          if ( arg_cnt >= 0 && subr_no >= 0 )
+          {
+            FT_ERROR(( "t1_decoder_parse_charstrings:"
+                       " unknown othersubr [%d %d], wish me luck\n",
+                       arg_cnt, subr_no ));
+            unknown_othersubr_result_cnt = arg_cnt;
+            break;
+          }
 
         Unexpected_OtherSubr:
           FT_ERROR(( "t1_decoder_parse_charstrings:"