RFR(XS): 8202181: Correctly specify size of hostname buffer in Unix Inet*AddressImpl_getLocalHostName implementations
Thomas Stüfe
thomas.stuefe at gmail.com
Fri Apr 27 05:02:57 UTC 2018
Hi Christoph,
code change makes sense. +1 on the "sizeof()" arg change.
I would prefer it though if you would move the zero-termination out of
the if/else altogether.
Best Regards, Thomas
On Tue, Apr 24, 2018 at 11:38 AM, Langer, Christoph
<christoph.langer at sap.com> wrote:
> 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
>
>
More information about the net-dev
mailing list