Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libfdt: fix undefined behaviour in fdt_offset_ptr()
Upstream commit d0b3ab0a0f46 ("libfdt: Fix undefined behaviour in fdt_offset_ptr()"). Using pointer arithmetic to generate a pointer outside a known object is, technically, undefined behaviour in C. Unfortunately, we were using that in fdt_offset_ptr() to detect overflows. To fix this we need to do our bounds / overflow checking on the offsets before constructing pointers from them. Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Fixes: #1967 Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
- Loading branch information