From 6683d81eb985fbf4e337da1bd77a1746654c9e86 Mon Sep 17 00:00:00 2001 From: Jerzy Jamroz Date: Tue, 11 Mar 2025 11:31:07 +0100 Subject: [PATCH] fix: strlen instead of strnlen. --- modules/libcom/src/iocsh/atInit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libcom/src/iocsh/atInit.c b/modules/libcom/src/iocsh/atInit.c index 85bd21a4c..9018f3ff5 100644 --- a/modules/libcom/src/iocsh/atInit.c +++ b/modules/libcom/src/iocsh/atInit.c @@ -57,7 +57,7 @@ static void atInitHook(const initHookState state) static struct cmditem *newItem(const char *cmd) { - const size_t cmd_len = strnlen(cmd, 32768 - 1) + 1; + const size_t cmd_len = strlen(cmd) + 1; struct cmditem *const item = mallocMustSucceed(sizeof(struct cmditem) + cmd_len, "atInit"); item->cmd = (char *)(item + 1); memcpy(item->cmd, cmd, cmd_len);