From 59b8c8cab103e1dcb0b7a28d1fedea6a4bc72e9d Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Thu, 27 Jun 2013 00:08:33 +0200 Subject: [PATCH] throw an error if the APDU is too big --- virtualsmartcard/src/vpcd/vpcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualsmartcard/src/vpcd/vpcd.c b/virtualsmartcard/src/vpcd/vpcd.c index 4f7e896..95eebe2 100644 --- a/virtualsmartcard/src/vpcd/vpcd.c +++ b/virtualsmartcard/src/vpcd/vpcd.c @@ -137,7 +137,7 @@ ssize_t sendToVICC(struct vicc_ctx *ctx, size_t length, const unsigned char* buf ssize_t r; uint16_t size; - if (!ctx) { + if (!ctx || length > 0xFFFF) { errno = EINVAL; return -1; }