Files
openwrt/package
Anna Kiri 2818ac5ccd mtd: check malloc() return value in mtd_check()
After malloc(erasesize) in mtd_check(), the result was never checked
for NULL. On allocation failure, the buf pointer remained NULL and
would later be used in image_check() via read(imagefd, buf + buflen,
...), causing a NULL pointer dereference.

Add a NULL check after the allocation and return early. The early
return path also closes the just-opened fd and frees the strdup'd
colon-separated device-list copy to avoid leaks.

Signed-off-by: Anna Kiri <bredcorn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23705
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-08 16:17:42 +02:00
..
2026-06-07 11:45:36 +02:00
2026-04-18 19:34:21 +02:00
2026-06-04 09:59:32 +02:00
2026-06-03 13:46:09 +02:00