fixed use of uninitialized values

This commit is contained in:
Frank Morgner 2019-01-28 09:38:15 +01:00
parent 01d515a026
commit 6fdb29a470
2 changed files with 4 additions and 3 deletions

View File

@ -819,7 +819,7 @@ authentic_read_binary(struct sc_card *card, unsigned int idx,
struct sc_context *ctx = card->ctx;
struct sc_apdu apdu;
size_t sz, rest, ret_count = 0;
int rv = SC_SUCCESS;
int rv = SC_ERROR_INVALID_ARGUMENTS;
LOG_FUNC_CALLED(ctx);
sc_log(ctx,
@ -865,7 +865,7 @@ authentic_write_binary(struct sc_card *card, unsigned int idx,
struct sc_context *ctx = card->ctx;
struct sc_apdu apdu;
size_t sz, rest;
int rv = SC_SUCCESS;
int rv = SC_ERROR_INVALID_ARGUMENTS;
LOG_FUNC_CALLED(ctx);
sc_log(ctx,
@ -908,7 +908,7 @@ authentic_update_binary(struct sc_card *card, unsigned int idx,
struct sc_context *ctx = card->ctx;
struct sc_apdu apdu;
size_t sz, rest;
int rv = SC_SUCCESS;
int rv = SC_ERROR_INVALID_ARGUMENTS;
LOG_FUNC_CALLED(ctx);
sc_log(ctx,

View File

@ -490,6 +490,7 @@ static int do_ls(int argc, char **argv)
u8 buf[256], *cur = buf;
int r, count;
memset(buf, 0, sizeof buf);
r = sc_lock(card);
if (r == SC_SUCCESS)
r = sc_list_files(card, buf, sizeof(buf));