From 1c0100006a7a2411c5667a0a48933d2f75707d37 Mon Sep 17 00:00:00 2001 From: Eric Duminil Date: Mon, 28 Feb 2022 11:59:33 +0100 Subject: [PATCH] Off-by-one error in string validation --- ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h b/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h index ecf50c8..6393411 100644 --- a/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h +++ b/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h @@ -419,7 +419,7 @@ protected: if (length > 0) { char parLength[11]; - snprintf(parLength, 11, "%d", length); + snprintf(parLength, 11, "%d", length - 1); // To allow "\0" at the end of the string. String maxLength = String("maxlength=") + parLength; pitem.replace("{l}", maxLength); } -- GitLab