Hello. Please review this patch to fix InetAddress.getLocalHost fails if the host name is larger HOST_NAME_MAX. The fix is to use strncpy, and supply the max length the host name can be, instead of using strcpy. There is no test supplied for this fix as I was unable to set the host name larger then MAXHOSTNAMELEN on the Linux and Solaris machines I tried. I tested the fix by adding code to Inet4AddressImpl.c to simulate a host name larger then MAXHOSTNAMELEN.

Webrev, can be found here: http://cr.openjdk.java.net/~dmocek/7089443/webrev.00

Thanks,
Darryl


Reply via email to