Skip to content

Commit 8a90802

Browse files
committed
unicode: fix moving to next codepoint on maliciously-crafted UTF-8 string.
Note that 6-byte UTF-8 is illegal now, so this chunk of code really needs to go away in any case, but that's a different problem. Fixes #79. Closes #80.
1 parent de4c0c7 commit 8a90802

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/physfs_unicode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ PHYSFS_uint32 __PHYSFS_utf8codepoint(const char **_str)
183183
if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */
184184
return UNICODE_BOGUS_CHAR_VALUE;
185185

186-
*_str += 6; /* skip to next possible start of codepoint. */
186+
*_str += 5; /* skip to next possible start of codepoint. */
187187
return UNICODE_BOGUS_CHAR_VALUE;
188188
} /* else if */
189189

0 commit comments

Comments
 (0)