mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2025-07-15 13:58:13 +02:00
ENS_FS: Only copy memory if read entry is valid
This commit is contained in:
parent
796cf0f089
commit
b90c8d7ec6
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue