Hello,

2010/9/15 JEAN Guillaume <guillaume.j...@supinfo.com>:
> I made a patch to remove a problem with the initialization of structures when 
> using Visual Studio debugger mode. Because
>  Visual Studio does not initialize the structure with 0 but random data. In 
> my case cdcdcdcd.

I don't think your patch is correct.
The problem is that refresh_attributes() is called with a not
correctly initialized reader parameter.

I propose the attached patch instead.
Can you try it and report success/failure?

Bye

-- 
 Dr. Ludovic Rousseau
Index: src/libopensc/reader-pcsc.c
===================================================================
--- src/libopensc/reader-pcsc.c (revision 4720)
+++ src/libopensc/reader-pcsc.c (working copy)
@@ -1693,7 +1693,7 @@
                        ret = SC_ERROR_OUT_OF_MEMORY;
                        goto err1;
                }
-               if ((priv = malloc(sizeof(struct pcsc_private_data))) == NULL) {
+               if ((priv = calloc(1, sizeof(struct pcsc_private_data))) == 
NULL) {
                        ret = SC_ERROR_OUT_OF_MEMORY;
                        goto err1;
                }
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to