From 47ea15edcd13cc5cc32411adc4fe0e4d69b7aebd Mon Sep 17 00:00:00 2001 From: Yudong Zhang Date: Mon, 16 May 2022 16:17:04 +0800 Subject: [PATCH] shell: mqtt: fix call to bin2hex Fixes: f2affbd973a7 ("os: lib: bin2hex: fix memory overwrite") Signed-off-by: Yudong Zhang --- subsys/shell/backends/shell_mqtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/shell/backends/shell_mqtt.c b/subsys/shell/backends/shell_mqtt.c index 0a4b3f29a43..861cb46526d 100644 --- a/subsys/shell/backends/shell_mqtt.c +++ b/subsys/shell/backends/shell_mqtt.c @@ -86,7 +86,7 @@ bool __weak shell_mqtt_get_devid(char *id, int id_max_len) } (void)memset(id, 0, id_max_len); - length = bin2hex(hwinfo_id, (size_t)length, id, id_max_len - 1); + length = bin2hex(hwinfo_id, (size_t)length, id, id_max_len); return length > 0; }