]> Kevux Git Server - fll/commitdiff
Bugfix: f_utf_unicode_string_to() not treating numbers larger than 0x10FFFF as invalid.
authorKevin Day <thekevinday@gmail.com>
Sat, 11 Dec 2021 04:43:40 +0000 (22:43 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 11 Dec 2021 04:43:40 +0000 (22:43 -0600)
The max unicode sequence is 0x10FFFF.
Anything beyond that must be treated as invalid.

level_0/f_utf/c/utf.c

index 80a9e8a192076cf4043dc1aa9cc134416f68cec4..0b913c695778a054ca59e6dc67b9bde17ca0b94f 100644 (file)
@@ -1914,6 +1914,10 @@ extern "C" {
       }
     } // for
 
+    if (value > 0x10ffff) {
+      return F_status_set_error(F_valid_not);
+    }
+
     *unicode = value;
 
     return F_none;