Files
u-boot/tools
Kory Maincent d5ea30b233 tools: fwumdata: Fix use-after-free in parse_config()
In parse_config(), devname is dynamically allocated by sscanf().
When sscanf() fails to fill enough fields (rc < 3), devname is freed and
the loop continues to the next line. However, if the next call to sscanf()
fails to match (rc == 0), devname is not written and still holds the stale
freed pointer. The subsequent free(devname) then operates on
already-freed memory.

Fix this by resetting devname to NULL before each sscanf() call, so
that a non-matching call leaves a NULL pointer and the subsequent
free() becomes a harmless no-op.

Reported-by: Coverity Scan
Link: https://lists.denx.de/pipermail/u-boot/2026-April/614161.html
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2026-05-12 09:31:51 +03:00
..
2025-12-10 09:28:43 -06:00
2026-01-02 10:28:14 -06:00
2026-05-11 12:05:10 -06:00
2024-09-12 17:35:37 +02:00
2025-06-03 17:18:02 -06:00
2023-01-27 12:51:26 -05:00
2024-07-15 12:12:18 -06:00
2025-11-10 11:30:56 -06:00
2026-04-06 12:16:57 -06:00
2024-07-15 12:12:18 -06:00
2025-01-26 11:35:46 -06:00
2025-04-11 12:16:44 -06:00