FYI: Fix InetAddress.getByName and loopback issues

Bryce McKinlay mckinlay@redhat.com
Sat Aug 14 21:38:00 GMT 2004


Bryce McKinlay wrote:

> Passing null to InetAddress.getByName() and getAllByName should return 
> the loopback InetAddress. Its possible to do this without the normal 
> security check - passing a null argument to SecurityManager would be a 
> NullPointerException. This also cleans up the security checks - 
> lookup() does not need to do a check becuase the public methods that 
> call it will have done it already. In the getByName() case, we were 
> actually doing the check 3 times - once in getByName, once in 
> getAllByName, and then again in lookup.


I also checked in some mauve tests for this.

Bryce



More information about the Java-patches mailing list