mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-15 17:34:43 +00:00
cmd: optee: fix hello subcommand argument check
When the `optee hello' subcommand is called, the do_optee_hello_world_ta()
function passes a NULL pointer to the strcmp() function while verifying its
input argument, which results in the following crash:
=> optee hello
"Synchronous Abort" handler, esr 0x96000010, far 0x0
Fix this by verifying the number of input arguments instead.
Fixes: e3cf80fbe0
("cmd: Add support for optee commands")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jerome Forissier <jerome.forissier@linaro.org>
Cc: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
This commit is contained in:
parent
ba13350d49
commit
c4b273e441
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ static int do_optee_hello_world_ta(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
{
|
||||
int ret, value = 0;
|
||||
|
||||
if (strcmp(argv[1], NULL))
|
||||
if (argc > 1)
|
||||
value = hextoul(argv[1], NULL);
|
||||
|
||||
ret = hello_world_ta(value);
|
||||
|
|
Loading…
Add table
Reference in a new issue