From 26e2d0e0968a642ce2581e18d319389adef112a0 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Fri, 23 May 2014 07:07:33 +0400 Subject: [PATCH] 8043507: javax.smartcardio.CardTerminals.list() fails on MacOSX Reviewed-by: valeriep --- jdk/src/share/native/sun/security/smartcardio/pcsc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jdk/src/share/native/sun/security/smartcardio/pcsc.c b/jdk/src/share/native/sun/security/smartcardio/pcsc.c index 8c33f2a03d2..ab30e138120 100644 --- a/jdk/src/share/native/sun/security/smartcardio/pcsc.c +++ b/jdk/src/share/native/sun/security/smartcardio/pcsc.c @@ -108,7 +108,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEXPORT jlong JNICALL Java_sun_security_smartcardio_PCSC_SCardEstablishContext (JNIEnv *env, jclass thisClass, jint dwScope) { - SCARDCONTEXT context; + SCARDCONTEXT context = 0; LONG rv; dprintf("-establishContext\n"); rv = CALL_SCardEstablishContext(dwScope, NULL, NULL, &context); @@ -180,7 +180,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_security_smartcardio_PCSC_SCardListReade SCARDCONTEXT context = (SCARDCONTEXT)jContext; LONG rv; LPTSTR mszReaders; - DWORD size; + DWORD size = 0; jobjectArray result; dprintf1("-context: %x\n", context); @@ -215,8 +215,8 @@ JNIEXPORT jlong JNICALL Java_sun_security_smartcardio_PCSC_SCardConnect SCARDCONTEXT context = (SCARDCONTEXT)jContext; LONG rv; LPCTSTR readerName; - SCARDHANDLE card; - DWORD proto; + SCARDHANDLE card = 0; + DWORD proto = 0; readerName = (*env)->GetStringUTFChars(env, jReaderName, NULL); if (readerName == NULL) { @@ -280,8 +280,8 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_smartcardio_PCSC_SCardStatus DWORD readerLen = READERNAME_BUFFER_SIZE; unsigned char atr[ATR_BUFFER_SIZE]; DWORD atrLen = ATR_BUFFER_SIZE; - DWORD state; - DWORD protocol; + DWORD state = 0; + DWORD protocol = 0; jbyteArray jArray; jbyte status[2];