mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2024-12-05 00:55:43 +01:00
ENS_FS: Only copy memory if read entry is valid
This commit is contained in:
parent
796cf0f089
commit
b90c8d7ec6
@ -90,10 +90,11 @@ int ens_fs_read(ens_fs_t* fs, uint64_t id, void* dest) {
|
||||
if (!isNotDeleted) {
|
||||
// entry got deleted
|
||||
rc = -ENS_DELENT;
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
memcpy(dest, obj, fs->entry_size);
|
||||
end:
|
||||
k_mutex_unlock(&fs->ens_fs_lock);
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user