aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jelen <[email protected]>2024-05-28 14:57:41 +0000
committerWerner Koch <[email protected]>2024-05-29 09:48:31 +0000
commit524e3a934568af9150b9d7c9766b4fe33b95a561 (patch)
treecde9cb834197cf64943a7565d24dccce0782928f
parentagent: Avoid uninitialized access in GENKEY command on parameter error. (diff)
downloadgnupg-524e3a934568af9150b9d7c9766b4fe33b95a561.tar.gz
gnupg-524e3a934568af9150b9d7c9766b4fe33b95a561.zip
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 <[email protected]> This is part of GnuPG-bug-id: 7129 Fixes-commit: e8534f899915a039610973a84042cbe25a5e7ce2 (cherry picked from commit 4c1b0070354db0b9b0516d9e5453e47fc03a0aac)
-rw-r--r--scd/apdu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scd/apdu.c b/scd/apdu.c
index 98158648b..2e38a273a 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -2094,7 +2094,7 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p)
nreader -= n + 1;
p += n + 1;
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");
dl->idx_max--;