mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2024-11-01 01:18: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) {
|
if (!isNotDeleted) {
|
||||||
// entry got deleted
|
// entry got deleted
|
||||||
rc = -ENS_DELENT;
|
rc = -ENS_DELENT;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
|
||||||
memcpy(dest, obj, fs->entry_size);
|
memcpy(dest, obj, fs->entry_size);
|
||||||
|
end:
|
||||||
k_mutex_unlock(&fs->ens_fs_lock);
|
k_mutex_unlock(&fs->ens_fs_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user