[PATCH] scripts: kconfig: fix deref after null in menu.c
Tom Rini
trini at konsulko.com
Fri May 16 16:58:30 CEST 2025
On Fri, May 16, 2025 at 05:56:11PM +0300, ant.v.moryakov at gmail.com wrote:
> From: Anton Moryakov <ant.v.moryakov at gmail.com>
>
> Static analyzer detected a potential NULL pointer dereference when 'sym'
> pointer is passed to for_all_prompts() and other functions after being
> checked for NULL earlier in the function.
>
> The issue could occur when called from gstr get_relations_str() with
> NULL symbol pointer.
>
> Changes made:
> 1. Added early return if sym is NULL or has no name
> 2. Added NULL checks before all sym pointer dereferences
> 3. Maintained existing functionality for valid symbols
>
> Signed-off-by: Anton Moryakov <ant.v.moryakov at gmail.com>
> ---
> scripts/kconfig/menu.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
Since this comes from the linux kernel, please see if it's a problem
there still (and report it please) or backport the fix, thanks.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250516/cc0b2536/attachment.sig>
More information about the U-Boot
mailing list