RFR: 8159695: Arguments::atojulong() fails to detect overflows

Dmitry Samersoff dmitry.samersoff at oracle.com
Mon Jun 27 09:25:56 UTC 2016


Marcus,

Looks good for me beside some nits.

597: It might be better to don't check for errno but check for LLONG_MAX
at 602

593: s[0] == '0' && ((s[1] | 0x20) == 'x') might be slightly more readable.

602  strlen call could be replaced with
      (*reminder != 0 && *(reminder+1) != 0)

-Dmitry

On 2016-06-27 11:35, Marcus Larsson wrote:
> Hi,
> 
> Please review the following patch to detect overflows in atojulong. The
> patch uses strtoull instead of sscanf, and adds a unit test for atojulong.
> 
> Webrev:
> http://cr.openjdk.java.net/~mlarsson/8159695/webrev.00/
> 
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8159695
> 
> Testing:
> JPRT testset hotspot and included unit test through RBT.
> 
> Thanks,
> Marcus


-- 
Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.


More information about the hotspot-runtime-dev mailing list