[Pcsclite-cvs-commit] r5532 - /trunk/PCSC/src/readerfactory.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Jan 20 09:20:43 UTC 2011


Author: rousseau
Date: Thu Jan 20 09:20:29 2011
New Revision: 5532

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5532
Log:
RDR_CLIHANDLES_seeker(): avoid a potential crash if NULL values are used

src/readerfactory.c:72:30: warning: Dereference of null pointer
        if (rdrCliHandles->hCard == *(SCARDHANDLE *)key)
                                    ^
src/readerfactory.c:72:21: warning: Dereference of null pointer
        if (rdrCliHandles->hCard == *(SCARDHANDLE *)key)
                           ^

Modified:
    trunk/PCSC/src/readerfactory.c

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=5532&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Thu Jan 20 09:20:29 2011
@@ -65,9 +65,12 @@
 	const RDR_CLIHANDLES *rdrCliHandles = el;
 
 	if ((el == NULL) || (key == NULL))
+	{
 		Log3(PCSC_LOG_CRITICAL,
 			"RDR_CLIHANDLES_seeker called with NULL pointer: el=%X, key=%X",
 			el, key);
+		return 0;
+	}
 
 	if (rdrCliHandles->hCard == *(SCARDHANDLE *)key)
 		return 1;




More information about the Pcsclite-cvs-commit mailing list