RFR: 8170544: Fix code scan findings in libnet

Chris Hegarty chris.hegarty at oracle.com
Tue Jan 3 13:59:29 UTC 2017


> On 29 Dec 2016, at 13:20, Langer, Christoph <christoph.langer at sap.com> wrote:
> 
> Hi Goetz,
> 
> thanks for reviewing this.
> 
> I have addressed your comments in a new webrev: http://cr.openjdk.java.net/~clanger/webrevs/8170544.1/

This mainly looks fine. Just a few comments:

1) NetworkInterface.c

    I’m not sure that the close is really necessary, since a JNI pending
    exception can only be thrown is sock is less than 0. I think just
    removing the ' && (*env)->ExceptionOccurred(env)’ from the original
    if statement should be sufficient, no? 

2) net_util.c  

    getInet6Address_scopeid_set should CHECK_NULL_RETURN(holder, JNI_FALSE)?
    getInet6Address_scopeid now returns an unsigned in, why CHECK_NULL_RETURN(holder, -1)?

    Some of this, existing, code seems a little dubious.

-Chris.


More information about the net-dev mailing list