diff --git a/npa/src/npa.c b/npa/src/npa.c index 5fe3614..1d68a23 100644 --- a/npa/src/npa.c +++ b/npa/src/npa.c @@ -305,12 +305,13 @@ static int npa_mse_set_at(struct sm_ctx *oldnpactx, sc_card_t *card, NPA_MSE_SET_AT_C *data = NULL; int r, tries; + memset(&apdu, 0, sizeof apdu); + if (!sw1 || !sw2) { r = SC_ERROR_INVALID_ARGUMENTS; goto err; } - memset(&apdu, 0, sizeof apdu); apdu.ins = 0x22; apdu.p1 = 0xc1; apdu.p2 = 0xa4; diff --git a/npa/src/sm.c b/npa/src/sm.c index e723ec4..d04a4c0 100644 --- a/npa/src/sm.c +++ b/npa/src/sm.c @@ -196,7 +196,7 @@ static int format_data(sc_card_t *card, const struct sm_ctx *ctx, { int r; u8 *pad_data = NULL; - size_t pad_data_len; + size_t pad_data_len = 0; if (!ctx || !formatted_data || !formatted_data_len) { r = SC_ERROR_INVALID_ARGUMENTS;