RFR(XS): 8202181: Correctly specify size of hostname buffer in Unix Inet*AddressImpl_getLocalHostName implementations

Langer, Christoph christoph.langer at sap.com
Thu Apr 26 18:56:46 UTC 2018


Ping, can some reviewer please have a look at this small fix?

Thanks
Christoph

From: Langer, Christoph
Sent: Dienstag, 24. April 2018 11:39
To: net-dev at openjdk.java.net
Subject: RFR(XS): 8202181: Correctly specify size of hostname buffer in Unix Inet*AddressImpl_getLocalHostName implementations

Hi,

please help reviewing a small change that I stumbled over when looking into the getLocalHostName implementation. I found that the length of the hostname buffer is not correctly passed to sub functions. The buffer size is specified as "NI_MAXHOST + 1", so this size should be handed down to gethostname() and getnameinfo() calls, not just NI_MAXHOST. I also moved the solaris #ifdefs into the else clause to spare a few lines of code.

Bug: https://bugs.openjdk.java.net/browse/JDK-8202181
Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8202181.0/

Thanks
Christoph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20180426/52d613e0/attachment.html>


More information about the net-dev mailing list