DFU: Check the number of arguments and argument string strictly
authorMasami Hiramatsu <masami.hiramatsu@linaro.org>
Mon, 31 Jan 2022 02:52:37 +0000 (11:52 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 11 Feb 2022 16:29:23 +0000 (11:29 -0500)
commit53b406369e9d0ba2da1df9b2488976c41acc6332
treef32d426e2b14d0b4bf72e0343a75dc38d519d6ab
parent8db74c153b4e30edc5290da6c7330c63558678d0
DFU: Check the number of arguments and argument string strictly

When parsing the dfu_alt_info, check the number of arguments
and argument string strictly. If there is any garbage data
(which is not able to be parsed correctly) in dfu_alt_info,
that means something wrong and user may make a typo or mis-
understanding about the syntax. Since the dfu_alt_info is
used for updating the firmware, this mistake may lead to
brick the hardware.
Thus it should be checked strictly for making sure there
is no mistake.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
drivers/dfu/dfu.c
drivers/dfu/dfu_mmc.c
drivers/dfu/dfu_mtd.c
drivers/dfu/dfu_nand.c
drivers/dfu/dfu_ram.c
drivers/dfu/dfu_sf.c
drivers/dfu/dfu_virt.c
include/dfu.h