Format: fixes a possible OOB read

This commit is contained in:
李通洲
2026-05-20 18:40:20 +08:00
parent 9bca4eb48f
commit 0ed27d9700
+6
View File
@@ -543,6 +543,12 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n
// jump to next char, the start of the placeholder value
++i;
// unmatched trailing '{'
if (i >= formatstr->length) {
ffStrbufAppendC(buffer, '{');
break;
}
// double {{ elvaluates to a single { and doesn't count as start
if (formatstr->chars[i] == '{') {
ffStrbufAppendC(buffer, '{');