8043507: javax.smartcardio.CardTerminals.list() fails on MacOSX
Reviewed-by: valeriep
--- a/jdk/src/share/native/sun/security/smartcardio/pcsc.c Thu May 22 14:39:32 2014 -0700
+++ b/jdk/src/share/native/sun/security/smartcardio/pcsc.c Fri May 23 07:07:33 2014 +0400
@@ -108,7 +108,7 @@
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 @@
SCARDCONTEXT context = (SCARDCONTEXT)jContext;
LONG rv;
LPTSTR mszReaders;
- DWORD size;
+ DWORD size = 0;
jobjectArray result;
dprintf1("-context: %x\n", context);
@@ -215,8 +215,8 @@
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 @@
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];