fixed uninitialized buffer

This commit is contained in:
Frank Morgner 2017-08-04 01:02:17 +02:00
parent f4946df4e9
commit 1b880b5675
2 changed files with 3 additions and 0 deletions

View File

@ -599,6 +599,8 @@ static int cardos_construct_fcp(sc_card_t *card, const sc_file_t *file,
/* we will add the length later */
p++;
memset(buf, 0, sizeof(buf));
/* set the length */
buf[0] = (file->size >> 8) & 0xff;
buf[1] = file->size & 0xff;

View File

@ -743,6 +743,7 @@ static int gids_set_security_env(sc_card_t *card,
assert(card != NULL && env != NULL);
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_NORMAL);
memset(sbuf, 0, sizeof(sbuf));
sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, INS_MANAGE_SECURITY_ENVIRONMENT, P1_DECIPHERMENT_INTERNAL_AUTHENTICATE_KEY_AGREEMENT, 0);
switch (env->operation) {