Review Request for JDK-8030114: [parfait] warnings from b119 for jdk.src.share.native.sun.security.smartcardio: JNI exception pending

Florian Weimer fweimer at redhat.com
Fri Feb 14 14:32:23 UTC 2014


On 02/14/2014 01:30 AM, Valerie (Yu-Ching) Peng wrote:

> Can someone please review the fixes which checks for pending exceptions
> in native code "pcsc.c"?
> The fix is straightforward for all except the changes under
> Java_sun_security_smartcardio_PCSC_SCardGetStatusChange(...) method
> which is somewhat complicated due to the need to free up memories.
>
> Webrev: http://cr.openjdk.java.net/~valeriep/8030114/webrev.00/

It seems to me there is a slight behavioral change in 
Java_sun_security_smartcardio_PCSC_SCardStatus.  I think the 
ArrayIndexOutofBoundsException is no longer thrown if the status array 
is too short.

The logic in Java_sun_security_smartcardio_PCSC_SCardGetStatusChange 
appears to be correct, but I wonder if it would be clearer to use calloc 
for allocation and avoid the interlocked i/j/k loop counters, at the 
cost of calling free on a few NULL pointers.

-- 
Florian Weimer / Red Hat Product Security Team



More information about the security-dev mailing list