vpcd: added more input checking (#328)
Some checks failed
Build / virtualsmartcard-macos (push) Has been cancelled
Build / virtualsmartcard-ubuntu (push) Has been cancelled
Build / ccid-ubuntu (push) Has been cancelled
Build / pcsc-relay-macos (push) Has been cancelled
Build / pcsc-relay-ubuntu (push) Has been cancelled
Build / pcsc-relay-mingw-64 (push) Has been cancelled
Build / remote-reader-ubuntu (push) Has been cancelled
Build / ACardEmulator-ubuntu (push) Has been cancelled
Coverity Scan / build (push) Has been cancelled

May fix unstability issues #326 #324

(cherry picked from commit 7c949d1ec0e40ca2aabf92192cdf9f66a4a7a0bf)
This commit is contained in:
Frank Morgner
2026-03-12 21:46:29 +01:00
committed by Christoph Honal
parent 0f84236f4a
commit d9c873dec3
6 changed files with 37 additions and 26 deletions

View File

@@ -70,6 +70,7 @@ bool VpcdReader::QueryATR(BYTE *ATR,DWORD *ATRsize,bool reset) {
if (atr_len > 0) {
/* TODO do length checking on length of ATR when ATRsize is
* correctly initialized by Reader.cpp */
atr_len = min(atr_len, *ATRsize);
memcpy(ATR, atr, atr_len);
*ATRsize = atr_len;
free(atr);