From 0fefc43f991ccb71f16223b3050a35f02502f6ba Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Thu, 30 Apr 2026 10:54:43 +0800 Subject: [PATCH] fix(openthread): always reserve null-terminator space when appending escaped args --- components/openthread/src/esp_openthread_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/openthread/src/esp_openthread_cli.c b/components/openthread/src/esp_openthread_cli.c index 50f90d53c38..59f504c3806 100644 --- a/components/openthread/src/esp_openthread_cli.c +++ b/components/openthread/src/esp_openthread_cli.c @@ -30,7 +30,7 @@ static TaskHandle_t s_cli_task; static bool append_escaped_ot_arg(char *buffer, size_t buffer_size, const char *arg) { size_t len = strlen(buffer); - size_t rem_size = (len < buffer_size) ? (buffer_size - len) : 0; + size_t rem_size = (len < buffer_size) ? (buffer_size - len - 1) : 0; ESP_RETURN_ON_FALSE(rem_size > 0, false, OT_PLAT_LOG_TAG, "CLI command buffer is full");