Commit 1c010000 authored by Eric Duminil's avatar Eric Duminil
Browse files

Off-by-one error in string validation

parent 95964301
Pipeline #5962 passed with stage
in 2 minutes and 31 seconds
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment