1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-12-26 03:09:12 +01:00
Files
u-boot-megous/cmd
Sam Protsenko aa51579f9a cmd: fastboot: Validate user input
In case when user provides '-' as USB controller index, like this:

    => fastboot -

data abort occurs in strcmp() function in do_fastboot(), here:

    if (!strcmp(argv[1], "udp"))

(tested on BeagleBone Black).

That's because argv[1] is NULL when user types in the '-', and null
pointer dereference occurs in strcmp() (which is ok according to C
standard specification). So we must validate user input to prevent such
behavior.

While at it, check also the result of strtoul() function and handle
error cases properly.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-08-21 16:21:37 +02:00
..
2017-02-08 15:56:28 -05:00
2018-05-08 18:50:23 -04:00
2018-08-11 09:16:08 +02:00
2017-07-03 17:35:28 -04:00
2018-05-23 17:30:05 -04:00
2018-08-21 16:21:37 +02:00
2018-08-17 13:03:54 -04:00
2018-08-11 09:16:08 +02:00
2018-07-24 09:25:23 -04:00
2017-08-16 08:30:24 -04:00
2016-10-06 20:57:42 -04:00
2018-06-05 20:19:08 -04:00
2018-08-10 10:27:32 -04:00
2018-05-08 09:07:35 -04:00
2018-07-26 11:43:30 -04:00
2018-07-02 14:14:20 -05:00