From 249e9281761fc861bab93f76baf6cdcefb1774ee Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 29 Nov 2019 16:23:02 +0100 Subject: [PATCH] gp: Correctly check for the CPLC data length --- src/libopensc/gp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libopensc/gp.c b/src/libopensc/gp.c index 61dbdb76..3abea28a 100644 --- a/src/libopensc/gp.c +++ b/src/libopensc/gp.c @@ -114,7 +114,7 @@ gp_get_cplc_data(struct sc_card *card, global_platform_cplc_data_t *cplc_data) /* We expect this will fill the whole structure in the argument. * If we got something else, report error */ - if ((size_t)apdu.resplen < sizeof(cplc_data)) { + if ((size_t)apdu.resplen < sizeof(global_platform_cplc_data_t)) { LOG_FUNC_RETURN(card->ctx, SC_ERROR_CORRUPTED_DATA); } LOG_FUNC_RETURN(card->ctx, apdu.resplen);