drivers/mtd/ubispl/ubispl.c: limit copy size
authorBenedikt Spranger <b.spranger@linutronix.de>
Wed, 17 Sep 2025 09:14:17 +0000 (11:14 +0200)
committerHeiko Schocher <hs@nabladev.com>
Wed, 8 Oct 2025 09:34:39 +0000 (11:34 +0200)
commit88e7a462f05d88bf3b782c3d06903b9cd1c19430
treec1a0792b405c029bda89e6e73b3c6799c55ce56d
parent75b7ef1caf19d467ee8a7e69eb5eccb6a45e1715
drivers/mtd/ubispl/ubispl.c: limit copy size

The fastmap VID header is embedded in struct ubi_scan_info. During fastmap
scan, the header is copied into struct ubi_scan_info, if valid. The former
code mixed up the amount of copied bytes and copied more bytes than
nessesary. This had no side effect, since the affected struct members are
uninitialized at that point and overwritten later.

Limit the copied bytes to the VID header size.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Reported-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/mtd/ubispl/ubispl.c