summaryrefslogtreecommitdiff
path: root/common/cli.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2026-07-06 18:26:12 -0600
committerTom Rini <trini@konsulko.com>2026-07-06 18:26:12 -0600
commitee5d46b45ec0c63f8f9dd1e816e0dac3452ccc3d (patch)
tree800cd9e204ca027144070101884c0d5d3c00130f /common/cli.c
parentece349ade2973e220f524ce59e59711cc919263f (diff)
parenta18265f1ccb7a272721ed4286ed3b5a6182ff424 (diff)
downloadu-boot-master.tar.gz
u-boot-master.zip
Merge branch 'next'HEADmasterWIP/06Jul2026
Diffstat (limited to 'common/cli.c')
-rw-r--r--common/cli.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/common/cli.c b/common/cli.c
index bcc7264d51a..87ce0e4d144 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -138,11 +138,9 @@ int run_command_list(const char *cmd, int len, int flag)
#endif
}
if (need_buff) {
- buff = malloc(len + 1);
+ buff = memdup_nul(cmd, len);
if (!buff)
return 1;
- memcpy(buff, cmd, len);
- buff[len] = '\0';
}
#ifdef CONFIG_HUSH_PARSER
if (use_hush_old()) {