SCardConnect: socketcall.sendto(msg) points to uninitialized byte(s)

Andrey R <[email protected]>
Newsgroups gmane.comp.lib.muscle
Message-ID <CAGmuJfDWHBAKKOwa9M70POWfme7qDFhODaghX3h0MbcRM-pJDQ@mail.gmail.com>
Hi.
Valgrind detected usage of uninitialized memory in SCardConnect:

==19635== Memcheck, a memory error detector
==19635== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==19635== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==19635== Command: /usr/rtests/bin/Pkcs11UnitTest.X64 pkcs11_common
==19635==
Running pkcs11_common
pkcs11_common::testGetInfo==19635== Syscall param socketcall.sendto(msg)
points to uninitialised byte(s)
==19635== at 0x605A1F7: send (send.c:32)
==19635== by 0xBC47CE6: ??? (in /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0)
==19635== by 0xBC47E22: ??? (in /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0)
==19635== by 0xBC43BBE: SCardConnect (in
/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0)
...

connect_struct.szReader involved. Patch for resolving the problem:
root@test-x64-ub13:/tmp# diff -u
pcsc-lite-1.8.16/src/winscard_clnt.c{,.patched}
--- pcsc-lite-1.8.16/src/winscard_clnt.c 2016-03-12 23:03:09.000000000 +0400
+++ pcsc-lite-1.8.16/src/winscard_clnt.c.patched 2016-04-07
16:20:28.193294111 +0400
@@ -764,7 +764,7 @@
LPDWORD pdwActiveProtocol)
{
LONG rv;
- struct connect_struct scConnectStruct;
+ struct connect_struct scConnectStruct = { 0 };
SCONTEXTMAP * currentContextMap;

PROFILE_START

_______________________________________________
Pcsclite-muscle mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.