classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java.security.Security bug


From: Mark Wielaard
Subject: Re: java.security.Security bug
Date: 13 Dec 2002 12:12:58 +0100

Hi,

On Fri, 2002-12-13 at 05:59, Casey Marshall wrote:
> The loadProviders method of java.security.Security has a rather silly
> bug in it:
> 
> - --- LINE 92 ---
> ~ while ((name = secprops.getProperty("security.provider." + i++)) !=
> ~        null)
> ~   {
> ~     Exception exception = null;
> 
> ~     try
> ~       {
>        providers.addElement(Class.forName(name).newInstance());
>        i++;
> 
> (etc.)
> - -----
> 
> The value `i' is incremented twice in the `while' loop. Remove one of
> them for the correct behavior.

Thanks for spotting this. Fixed by moving the i++ to the end of the
while loop outside the try-catch block (otherwise i would not get
incremented at all when a provider failed to load).

Cheers,

Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]