You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

freetype-2.3.11-CVE-2010-2806.patch 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --- freetype-2.3.11/src/type42/t42parse.c 2009-07-03 15:28:24.000000000 +0200
  2. +++ freetype-2.3.11/src/type42/t42parse.c 2010-09-23 12:15:56.000000000 +0200
  3. @@ -4,7 +4,7 @@
  4. /* */
  5. /* Type 42 font parser (body). */
  6. /* */
  7. -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
  8. +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
  9. /* Roberto Alameda. */
  10. /* */
  11. /* This file is part of the FreeType project, and may only be used, */
  12. @@ -575,6 +575,12 @@
  13. }
  14. string_size = T1_ToInt( parser );
  15. + if ( string_size < 0 )
  16. + {
  17. + FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
  18. + error = T42_Err_Invalid_File_Format;
  19. + goto Fail;
  20. + }
  21. T1_Skip_PS_Token( parser ); /* `RD' */
  22. if ( parser->root.error )
  23. @@ -582,13 +588,14 @@
  24. string_buf = parser->root.cursor + 1; /* one space after `RD' */
  25. - parser->root.cursor += string_size + 1;
  26. - if ( parser->root.cursor >= limit )
  27. + if ( limit - parser->root.cursor < string_size )
  28. {
  29. FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
  30. error = T42_Err_Invalid_File_Format;
  31. goto Fail;
  32. }
  33. + else
  34. + parser->root.cursor += string_size + 1;
  35. }
  36. if ( !string_buf )