XS RFR: 8006103: [parfait] Possible null pointer dereference at hotspot/src/os/linux/vm/os_linux.cpp; os_windows.cpp; os_solaris.cpp; os_bsd.cpp

Calvin Cheung calvin.cheung at oracle.com
Thu Apr 4 11:50:14 PDT 2013


On 4/3/2013 9:56 PM, David Holmes wrote:
> On 2/04/2013 3:10 AM, Calvin Cheung wrote:
>> Simple fix is to add null check on pelements.
>
> This warning is bogus. You will only get NULL if n==0 and if n==0 then 
> you don't dereference pelements.
After reading the os::split_path(), n will always be set to 0 if a NULL 
is returned.
Yes, I agreed with the above.
But adding a null check should do no harm and make the code easier to 
understand.
I'll check with the parfait dev team and see if they can make the tool 
"smarter".

thanks,
Calvin

>
> David
> -----
>
>> webrev: http://cr.openjdk.java.net/~ccheung/8006103/webrev/
>> bug: https://jbs.oracle.com/bugs/browse/JDK-8006103
>>
>> Test: jprt run was successful.
>>
>> thanks,
>> Calvin



More information about the hotspot-runtime-dev mailing list