JDK-7089443 : InetAddress.getLocalHost fails if hostname larger HOST_NAME_MAX.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_redhat_5.0
  • CPU: x86
  • Submitted: 2011-09-12
  • Updated: 2017-09-14
  • Resolved: 2012-01-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Relates :  
Description
A CU reported a case which causes bufferoverflow.

REPRODUCE:
1. Set hostname length longer than 65

ex.
localrh64.a12345678.b12345678.c12345678.d12345678.e12345678.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn.abcdefghijklmn

2. Execute attached test program

$ java -version
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b04)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)

$ java -Djava.net.preferIPv4Stack=true Inet
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00002aaaab346a2e, pid=7230, tid=1095264576

Comments
EVALUATION The strcpy should be a strncpy.
12-09-2011