Remove possible out-of-bounds memory access in fl_utf8_previous_composed_char (#1542)

This commit is contained in:
ManoloFLTK
2026-07-28 21:31:27 +02:00
parent f0c8f5aeb1
commit 18356f0530
+1
View File
@@ -1728,6 +1728,7 @@ const char *fl_utf8_previous_composed_char(const char *from, const char *begin)
from = fl_utf8back(from - 1, begin, keep);
unsigned u = fl_utf8decode(from, keep, NULL);
if (u >= 0x1F1E6 && u <= 0x1F1FF) { // a 1st regional indicator symbol can be a flag
if (from <= begin) return begin;
const char *previous = fl_utf8back(from - 1, begin, NULL);
u = fl_utf8decode(previous, keep, NULL);
if (u >= 0x1F1E6 && u <= 0x1F1FF) { // a 2nd Regional indicator symbol gives a flag