Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion subsys/storage/flash_map/flash_map_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static inline struct flash_area const *get_flash_area_from_id(int idx)
static inline bool is_in_flash_area_bounds(const struct flash_area *fa,
off_t off, size_t len)
{
return (off >= 0) && ((off + len) <= fa->fa_size);
return (off >= 0) && (off < fa->fa_size) && (len <= (fa->fa_size - off));
}

#endif /* ZEPHYR_SUBSYS_STORAGE_FLASH_MAP_PRIV_H_ */
Loading