RFR(S): 8156521: Minor Fixes and cleanups in NetworkInterface.c
Chris Hegarty
chris.hegarty at oracle.com
Wed May 11 08:50:10 UTC 2016
Hi Christoph,
On 11 May 2016, at 08:43, Dmitry Samersoff <dmitry.samersoff at oracle.com> wrote:
>> ...
>> bugreport: https://bugs.openjdk.java.net/browse/JDK-8156521
>>
>> webrev: http://cr.openjdk.java.net/~clanger/webrevs/8156521.0/
I think this is mainly fine, and good to have such cleanup in this area.
I agree with the replacement of strcpy with strncpy, but I think we should
explicitly null terminate in case the src is greater or equal to the dst buffer
size. This is done elsewhere in this file too, e.g.
strncpy(buf, input, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
>> Apart from quite a few whitespace changes to clean up the coding, I went
>> through and replaced all occurences of strcpy with strncpy as this was a
>> finding of a code scanner that we used. Also in function
>> “enumIPv6Interfaces” for Linux the local variable plen was changed from
>> int to short.
Why was this done for plen specifically, and not scope, or others ?
-Chris.
More information about the net-dev
mailing list