diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c index 0a66bcb5..bc1f22dc 100644 --- a/src/tools/opensc-explorer.c +++ b/src/tools/opensc-explorer.c @@ -1530,14 +1530,14 @@ static int do_erase(int argc, char **argv) static int do_random(int argc, char **argv) { - unsigned char buffer[256]; + unsigned char buffer[SC_MAX_EXT_APDU_BUFFER_SIZE]; int r, count; if (argc != 1) return usage(do_random); count = atoi(argv[0]); - if (count < 0 || count > 256) { + if (count < 0 || (size_t) count > sizeof buffer) { printf("Number must be in range 0..256\n"); return -1; } @@ -1625,8 +1625,8 @@ static int do_put_data(int argc, char **argv) static int do_apdu(int argc, char **argv) { sc_apdu_t apdu; - u8 buf[SC_MAX_APDU_BUFFER_SIZE * 2]; - u8 rbuf[SC_MAX_APDU_BUFFER_SIZE * 2]; + u8 buf[SC_MAX_EXT_APDU_BUFFER_SIZE * 2]; + u8 rbuf[SC_MAX_EXT_APDU_BUFFER_SIZE]; size_t len, i; int r; diff --git a/src/tools/opensc-tool.c b/src/tools/opensc-tool.c index 102492c6..b285b28f 100644 --- a/src/tools/opensc-tool.c +++ b/src/tools/opensc-tool.c @@ -498,8 +498,8 @@ static int list_files(void) static int send_apdu(void) { sc_apdu_t apdu; - u8 buf[SC_MAX_APDU_BUFFER_SIZE], - rbuf[SC_MAX_APDU_BUFFER_SIZE]; + u8 buf[SC_MAX_EXT_APDU_BUFFER_SIZE], + rbuf[SC_MAX_EXT_APDU_BUFFER_SIZE]; size_t len0, r; int c;