avoiding problems due to uninitialized values

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@407 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2011-02-05 22:06:07 +00:00
parent 1edfcc941e
commit 8bb7b592d6
2 changed files with 3 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;