Fix potential crash on delete file.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-03-09 18:16:18 +01:00
parent 599e5edbd1
commit be03298832

View File

@@ -114,7 +114,7 @@ uintptr_t allocate_free_addr(uint16_t size, bool persistent) {
} }
int flash_clear_file(file_t *file) { int flash_clear_file(file_t *file) {
if (file == NULL) { if (file == NULL || file->data == NULL) {
return CCID_OK; return CCID_OK;
} }
uintptr_t base_addr = uintptr_t base_addr =