summaryrefslogtreecommitdiff
path: root/cmd/optee.c
diff options
context:
space:
mode:
authorVincent StehlĂ© <[email protected]>2025-04-04 14:53:58 +0200
committerTom Rini <[email protected]>2025-04-11 12:16:32 -0600
commitc4b273e441327f74449b3035d61ea92a077c1baa (patch)
tree6d4b13a6690115f6a5755a1563caf3f42946d953 /cmd/optee.c
parentba13350d49370373bda42f9823d923adbee0e764 (diff)
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: e3cf80fbe02d ("cmd: Add support for optee commands") Signed-off-by: Vincent StehlĂ© <[email protected]> Cc: Jens Wiklander <[email protected]> Cc: Ilias Apalodimas <[email protected]> Cc: Tom Rini <[email protected]> Cc: Jerome Forissier <[email protected]> Cc: Venkatesh Yadav Abbarapu <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
Diffstat (limited to 'cmd/optee.c')
-rw-r--r--cmd/optee.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/optee.c b/cmd/optee.c
index d0d37293986..e3aae5e9f9b 100644
--- a/cmd/optee.c
+++ b/cmd/optee.c
@@ -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);