diff options
author | Carlos López <carlos.lopezr4096@gmail.com> | 2025-04-24 17:08:19 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-04-28 13:25:59 -0600 |
commit | 2c529839a93d886253c596449545f62bec21a4ac (patch) | |
tree | 701328ac0c5c58c54502a095b76aca895da8be91 /arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | |
parent | 23e7088dde1a182bbc6b75bc642ee789f23429b2 (diff) |
mkimage: fix option parsing segfault
getopt_long() expects a NULL-terminated list of structures. The current
list in mkimage does not have a zero-filled structure at the end, which
can cause getopt_long() to walk past the end of the array when passing
an unknown option, causing a segmentation fault.
As a reproducer, the following command causes a segmentation fault
(tested in Debian 12):
mkimage --foobar
Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c')
0 files changed, 0 insertions, 0 deletions