Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zephyr: fix overflow and overlap checks in memcpy_s
This patch addresses an issue in the `memcpy_s` function within the Zephyr RTOS string header. The issue was identified during IPC3 fuzz testing with UndefinedBehaviorSanitizer enabled. Changes include: - Adding `stdint.h` for `uintptr_t` type. - Adding checks to prevent overflow in pointer arithmetic. - Adjusting overlap checks to avoid overflow. These changes ensure that the `memcpy_s` function correctly handles edge cases, preventing undefined behavior due to pointer arithmetic overflow and memory overlap. Fixes #9768 Signed-off-by: Tomasz Leman <[email protected]>
- Loading branch information