From e451b844509763c581e7388e580b27570637e5a7 Mon Sep 17 00:00:00 2001 From: drho1y Date: Thu, 16 Jul 2026 03:46:24 +0300 Subject: [PATCH] fix: CWE-119 --- arduino_code/Test/src/mqtt_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino_code/Test/src/mqtt_handler.cpp b/arduino_code/Test/src/mqtt_handler.cpp index d4862e9..e896ef9 100644 --- a/arduino_code/Test/src/mqtt_handler.cpp +++ b/arduino_code/Test/src/mqtt_handler.cpp @@ -441,7 +441,7 @@ void handleServoMQTTCommand(const char* topic, const char* payload) { int channel = -1; char command[32] = {0}; - if (sscanf(topic, "servo/control/%d/%s", &channel, command) != 2) { + if (sscanf(topic, "servo/control/%2d/%8s", &channel, command) != 2) { Serial.printf("Invalid servo topic: %s\n", topic); return; }