Skip to content

Commit 036843f

Browse files
committed
[Valgrind] Fix buffer overflow in Unicode wildcard matching.
Check that both pattern and source buffers have more contents before reading from them both.
1 parent a24f115 commit 036843f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libfoundation/src/foundation-unicode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ bool MCUnicodeWildcardMatch(const void *source_chars, uindex_t source_length, bo
22392239

22402240
codepoint_t t_source_cp, t_pattern_cp;
22412241

2242-
while (t_source_filter -> HasData())
2242+
while (t_source_filter -> HasData() && t_pattern_filter -> HasData())
22432243
{
22442244
t_source_cp = t_source_filter -> GetNextCodepoint();
22452245
t_pattern_cp = t_pattern_filter -> GetNextCodepoint();

0 commit comments

Comments
 (0)