From 064057166b2a33c1367c24308427af9497bffab5 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 26 May 2009 00:22:20 +0000 Subject: [PATCH] * parse.y (parser_yyerror): get rid of possible overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parse.y b/parse.y index 8848145042..c72e58b19a 100644 --- a/parse.y +++ b/parse.y @@ -4885,7 +4885,8 @@ parser_yyerror(struct parser_params *parser, const char *msg) const int max_line_margin = 30; const char *p, *pe; char *buf; - int len, i; + long len; + int i; compile_error(PARSER_ARG "%s", msg); p = lex_p; @@ -4922,7 +4923,7 @@ parser_yyerror(struct parser_params *parser, const char *msg) buf[len] = '\0'; rb_compile_error_append("%s%s%s", pre, buf, post); - i = lex_p - p; + i = (int)(lex_p - p); p2 = buf; pe = buf + len; while (p2 < pe) {