fixed 323588 Uninitialized scalar variable

accessing uninitialized data with mlock is undefined behavior
This commit is contained in:
Frank Morgner 2020-02-18 22:30:12 +01:00
parent 21ee26b070
commit dca02dd9a0
2 changed files with 2 additions and 2 deletions

View File

@ -2062,7 +2062,7 @@ coolkey_process_combined_object(sc_card_t *card, coolkey_private_data_t *priv, u
}
memcpy(priv->token_name, &decompressed_header->token_name[0],
decompressed_header->token_name_length);
priv->token_name[decompressed_header->token_name_length] = 0;
priv->token_name[decompressed_header->token_name_length] = '\0';
priv->token_name_length = decompressed_header->token_name_length;

View File

@ -902,7 +902,7 @@ void *sc_mem_secure_alloc(size_t len)
len = pages * page_size;
}
p = malloc(len);
p = calloc(1, len);
if (p == NULL) {
return NULL;
}