Skip to content

Commit

Permalink
* parse.y (parser_yyerror): get rid of possible overflow.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed May 26, 2009
1 parent 5a9f87f commit 0640571
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0640571

Please sign in to comment.