@ -0,0 +1,42 @@ |
|||||
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
||||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
# |
||||
|
# Filename: package/.../libchipcard/0002-libchipcard-5.0.0-init-reader-state.patch |
||||
|
# Copyright (C) 2011 The OpenSDE Project |
||||
|
# |
||||
|
# More information can be found in the files COPYING and README. |
||||
|
# |
||||
|
# This patch file is dual-licensed. It is available under the license the |
||||
|
# patched project is licensed under, as long as it is an OpenSource license |
||||
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
||||
|
# of the GNU General Public License as published by the Free Software |
||||
|
# Foundation; either version 2 of the License, or (at your option) any later |
||||
|
# version. |
||||
|
# --- SDE-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
Description: Use the same struct when initializing the reader state with zero bytes avoids |
||||
|
uninitialized memory or buffer overflow. |
||||
|
Origin: Upstream |
||||
|
|
||||
|
Index: trunk/src/lib/client/base/client.c
|
||||
|
===================================================================
|
||||
|
--- trunk/src/lib/client/base/client.c (revision 589)
|
||||
|
+++ trunk/src/lib/client/base/client.c (revision 590)
|
||||
|
@@ -872,7 +872,7 @@
|
||||
|
DBG_INFO(LC_LOGDOMAIN, "Creating reader \"%s\"", p); |
||||
|
i=cl->readerCount; |
||||
|
/* preset */ |
||||
|
- memset((void*) &(cl->readerStates[i]), 0, sizeof(SCARD_READERSTATE_A));
|
||||
|
+ memset((void*) &(cl->readerStates[i]), 0, sizeof(SCARD_READERSTATE));
|
||||
|
cl->readerStates[i].szReader=p; |
||||
|
cl->readerStates[i].dwCurrentState=SCARD_STATE_UNAWARE; |
||||
|
/* reader added */ |
||||
|
@@ -948,7 +948,7 @@
|
||||
|
assert(cl); |
||||
|
|
||||
|
/* clear reader list and reader status list */ |
||||
|
- memset((void*) &cl->readerStates, 0, sizeof(SCARD_READERSTATE_A)*MAX_READERS);
|
||||
|
+ memset((void*) &cl->readerStates, 0, sizeof(SCARD_READERSTATE)*MAX_READERS);
|
||||
|
cl->readerCount=0; |
||||
|
free(cl->readerList); |
||||
|
cl->readerList=NULL; |