RFR: JDK-8049516: sun.security.provider.SeedGenerator throws ArrayIndexOutOfBoundsException

Wang Weijun weijun.wang at oracle.com
Thu Sep 22 01:18:49 UTC 2016


> On Sep 22, 2016, at 8:34 AM, Xuelei Fan <xuelei.fan at oracle.com> wrote:
> 
> > latch = (latch + 1) & 0x7FFFFFFF;  // Mask the sign bit
> I'm fine with it.
> 
> BTW, if you like, I may suggest to use a little bit small number for the mask, for example 0x1FFFFFFF, so that the counter variable does not overflow either.  It works if counter overflow, but better not if we want the counter meaningful.

Good idea.

--Max




More information about the security-dev mailing list