[Patch] PR java/22113: Fix buffer overflow in Java lexer for FP literals

Ranjit Mathew rmathew@gmail.com
Tue Aug 16 18:35:00 GMT 2005


On 8/16/05, David Daney <ddaney@avtrex.com> wrote:
> Ranjit Mathew wrote:
> >
> >   This is a naive but effective patch for PR java/22113 where
> > the 'literal_token' buffer of do_java_lex() in lex.c for reading
> > in an FP literal was overflowing in cases like the Jacks testcase
> > 3.10.2-round-6.
> 
> What is the actual length of the longest of the tokens in question
> allowed by the JLS?

~shrug~

JLS 3.10.2 doesn't seem to specify token-length per se for FP literals:

http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.2


> It seems if it is unbounded, that this is not the correct fix.
> Otherwise it seems unlikely that the upper bound is exactly 256.

Perhaps. In this particular case, I just wanted to have a quick
and effective fix for this issue as it keeps showing up as spurious
FAILs on different testsuite runs.

My 2p.

Thanks,
Ranjit.

-- 
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/



More information about the Java-patches mailing list