coap_uri.c: Fix off by one checking error

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2025-12-29 11:57:15 +00:00
1 parent 53318b81ae
commit dadb9a36f1
1 file changed
+1 -1
+1 -1
View File
@@ -466,7 +466,7 @@ check_segment(const uint8_t *s, size_t length, size_t *segment_size) {
while (length) {
if (*s == '%') {
if (length < 2 || !(isxdigit(s[1]) && isxdigit(s[2])))
if (length < 3 || !(isxdigit(s[1]) && isxdigit(s[2])))
return -1;
s += 2;