1
1
openwrt/package
Anna Kiri df26b8723a
mtd: jffs2: add missing malloc NULL check
In mtd_replace_jffs2(), the return value of malloc(erasesize) is never
checked. If the allocation fails, buf remains NULL and the subsequent
memcpy(buf + ofs, ...) in add_data() will dereference NULL, causing a
segfault.

Add a NULL check and return -1 on allocation failure. Match the
diagnostic message used by the sibling mtd_write_jffs2() so the
out-of-memory cause is visible at the call site.

Signed-off-by: Anna Kiri <bredcorn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23553
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-31 23:57:14 +02:00
..
base-files base-files: add options to disable default button handling 2026-05-20 00:02:31 +02:00
boot uboot-sunxi: bump to 2026.04 2026-05-29 08:23:24 +02:00
devel package: binutils: deduplicate ld 2026-04-18 19:34:21 +02:00
firmware linux-firmware: fix mediatek 2.5G PHY firmware dependency 2026-05-31 20:14:45 +01:00
kernel kernel: crypto-sha512-arm64: do not package with kernel 6.18 2026-05-28 10:15:20 +02:00
libs libubox: update to Git HEAD (2026-05-23) 2026-05-23 19:33:16 +02:00
network ethtool: update to 7.0 2026-05-29 10:50:41 +02:00
system mtd: jffs2: add missing malloc NULL check 2026-05-31 23:57:14 +02:00
utils util-linux: update to 2.42.1 2026-05-19 23:39:29 +02:00
Makefile build: add CycloneDX SBOM processing to apk 2026-05-17 12:21:09 +02:00