mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Format: fixes a possible OOB read
This commit is contained in:
@@ -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, '{');
|
||||
|
||||
Reference in New Issue
Block a user