From efc8509f72124cc5e6cd75343726d88969c3ab1a Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Fri, 3 Jul 2009 18:01:27 +0900 Subject: [PATCH] psaux: Prevent invalid arguments to afm_parser_read_vals(). --- ChangeLog | 10 ++++++++++ src/psaux/afmparse.c | 4 ++-- src/psaux/afmparse.h | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4b852813..20defa0d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-07-03 suzuki toshiya + + psaux: Prevent invalid arguments to afm_parser_read_vals(). + + * src/psaux/afmparse.c (afm_parser_read_vals): Change + the type of `n' to prevent negative number how to + many arguments should be parsed. + + * src/psaux/afmparse.h (afm_parser_read_vals): Ditto. + 2009-07-03 suzuki toshiya base: Prevent some overflows on LP64 systems. diff --git a/src/psaux/afmparse.c b/src/psaux/afmparse.c index 0a0f24927..44fe42fac 100644 --- a/src/psaux/afmparse.c +++ b/src/psaux/afmparse.c @@ -366,11 +366,11 @@ FT_LOCAL_DEF( FT_Int ) afm_parser_read_vals( AFM_Parser parser, AFM_Value vals, - FT_Int n ) + FT_UInt n ) { AFM_Stream stream = parser->stream; char* str; - FT_Int i; + FT_UInt i; if ( n > AFM_MAX_ARGUMENTS ) diff --git a/src/psaux/afmparse.h b/src/psaux/afmparse.h index c2fce75c8..7772dc79d 100644 --- a/src/psaux/afmparse.h +++ b/src/psaux/afmparse.h @@ -71,7 +71,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Int ) afm_parser_read_vals( AFM_Parser parser, AFM_Value vals, - FT_Int n ); + FT_UInt n ); /* read the next key from the next line or column */ FT_LOCAL( char* )