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
..
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2017-02-08 15:56:28 -05:00
2018-05-08 18:50:23 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-06-18 13:55:13 -04:00
2018-08-11 09:16:08 +02:00
2018-05-07 09:34:12 -04:00
2017-07-03 17:35:28 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-23 17:30:05 -04:00
2018-07-25 15:00:24 +02:00
2018-06-19 07:31:45 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-06-24 08:56:33 +08:00
2018-08-10 13:50:15 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-08-21 16:21:37 +02:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-06-01 11:37:31 +02:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2016-03-17 21:27:37 -06:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-06-18 14:02:04 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-08-17 13:03:54 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-08-11 09:16:08 +02:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2016-03-14 15:34:50 -06:00
2018-06-18 14:43:13 -04:00
2018-05-07 09:34:12 -04:00
2018-07-24 09:25:23 -04:00
2017-08-16 08:30:24 -04:00
2018-07-26 14:08:20 -05:00
2018-07-20 15:55:09 -04:00
2018-05-07 09:34:12 -04:00
2016-10-06 20:57:42 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-18 08:27:26 +02:00
2018-06-05 20:19:08 -04:00
2018-05-07 09:34:12 -04:00
2017-08-20 09:54:30 -04:00
2018-05-07 09:34:12 -04:00
2018-06-07 20:06:29 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-08-10 10:27:32 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-08 09:07:35 -04:00
2018-05-07 09:34:12 -04:00
2018-07-19 16:17:58 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2016-01-25 10:39:43 -05:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-06-07 20:06:29 -04:00
2018-05-07 09:34:12 -04:00
2018-05-25 20:12:55 -04:00
2018-07-28 11:57:38 -04:00
2018-05-25 20:12:55 -04:00
2018-07-28 11:57:38 -04:00
2018-07-28 11:57:38 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-07-26 11:43:30 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-06-07 20:06:29 -04:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00
2018-07-02 14:14:20 -05:00
2018-05-07 09:34:12 -04:00
2016-01-25 10:39:43 -05:00
2018-05-07 09:34:12 -04:00
2018-05-07 09:34:12 -04:00