tool: ifwitool: Fix buffer overflow
authorMikhail Ilin <ilin.mikhail.ol@gmail.com>
Fri, 18 Nov 2022 11:50:24 +0000 (14:50 +0300)
committerTom Rini <trini@konsulko.com>
Thu, 8 Dec 2022 14:25:44 +0000 (09:25 -0500)
commit2d1b2ac13fe5be6aa149e7a8ab5b059f0ad05476
treec6b73ec6631bbe3536f6fc316545c8b9d52917c1
parent164232943c77409921f0d1add63d1e41f0460715
tool: ifwitool: Fix buffer overflow

An incorrect 1st parameter is passed to the fix_member()
 function. Should use a pointer to the beginning of the parent structure
 (bpdt or subpart_dir, because are boxed), not to their fields. Otherwise,
 this leads to an overrun of the structure boundary, since in the
 fix_member() function, an 'offset' is made, relative to the 1st argument,
 which itself is an 'offset' from the beginning of the structure.

Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/ifwitool.c