1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00

scd: Avoid buffer overrun with more than 16 PC/SC readers.

* scd/apdu.c (apdu_dev_list_start): Fix end condition.

--

Signed-off-by: Jakub Jelen <jjelen@redhat.com>

This is part of
GnuPG-bug-id: 7129
Fixes-commit: e8534f8999

(cherry picked from commit 4c1b007035)
This commit is contained in:
Jakub Jelen 2024-05-28 16:57:41 +02:00 committed by Werner Koch
parent 521455df07
commit 524e3a9345
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -2094,7 +2094,7 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p)
nreader -= n + 1; nreader -= n + 1;
p += n + 1; p += n + 1;
dl->idx_max++; dl->idx_max++;
if (dl->idx_max > MAX_READER) if (dl->idx_max >= MAX_READER)
{ {
log_error ("too many readers from pcsc_list_readers\n"); log_error ("too many readers from pcsc_list_readers\n");
dl->idx_max--; dl->idx_max--;