diff options
Diffstat (limited to 'scard-opensc.c')
-rw-r--r-- | scard-opensc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scard-opensc.c b/scard-opensc.c index e8e12dd85..4ab87ea8a 100644 --- a/scard-opensc.c +++ b/scard-opensc.c | |||
@@ -89,6 +89,12 @@ sc_init(void) | |||
89 | r = sc_establish_context(&ctx, "openssh"); | 89 | r = sc_establish_context(&ctx, "openssh"); |
90 | if (r) | 90 | if (r) |
91 | goto err; | 91 | goto err; |
92 | if (sc_reader_id >= ctx->reader_count) { | ||
93 | r = SC_ERROR_NO_READERS_FOUND; | ||
94 | error("Illegal reader number %d (max %d)", sc_reader_id, | ||
95 | ctx->reader_count -1); | ||
96 | goto err; | ||
97 | } | ||
92 | r = sc_connect_card(ctx->reader[sc_reader_id], 0, &card); | 98 | r = sc_connect_card(ctx->reader[sc_reader_id], 0, &card); |
93 | if (r) | 99 | if (r) |
94 | goto err; | 100 | goto err; |