Skip to content

Commit 25c93c2

Browse files
committed
Fix potential crash on loading dkek.
Signed-off-by: Pol Henarejos <[email protected]>
1 parent 001d076 commit 25c93c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hsm/kek.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int mse_decrypt_ct(uint8_t *data, size_t len) {
110110

111111
int load_dkek(uint8_t id, uint8_t *dkek) {
112112
file_t *tf = search_file(EF_DKEK + id);
113-
if (!tf) {
113+
if (!file_has_data(tf)) {
114114
return CCID_ERR_FILE_NOT_FOUND;
115115
}
116116
memcpy(dkek, file_get_data(tf), DKEK_KEY_SIZE);

0 commit comments

Comments
 (0)