Closed dmercer-google closed 3 years ago
Thank you for finding this. Also other locations in the project are not initializing variables to a default value, but I think in these locations the variables are later assigned to a value and are not evaluated before working on uninitialized memory, I guess which was the case for the dummy
variable, although according to the API this actually should not be the case. I'm also wondering why I have named the variable dummy
.
This took me quite a while to figure out. What I was seeing was that when I called
OPGP_list_readers
prior to callingOPGP_card_connect
the variabledummy
at line 196 ofgppcscconnectionplugin/src/gppcscconnectionplugin.c
was being populated with some very large invalid number which was then causingSCardStatus
to fail with0x8010000F, Card protocol mismatch
. Initialingdummy
to 0 fixed the issue. I then initialized all variables in the file.Note: I was calling into the code from a Go app. No idea if that had anything to do with it.
macOS Catalina version 10.15.7 go version go1.15.3 darwin/amd64