Преглед изворни кода

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.
Ryan C. Gordon пре 2 месеци
родитељ
комит
8a90802778
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/physfs_unicode.c

+ 1 - 1
src/physfs_unicode.c

@@ -183,7 +183,7 @@ PHYSFS_uint32 __PHYSFS_utf8codepoint(const char **_str)
         if ((octet & (128+64)) != 128)  /* Format isn't 10xxxxxx? */
         if ((octet & (128+64)) != 128)  /* Format isn't 10xxxxxx? */
             return UNICODE_BOGUS_CHAR_VALUE;
             return UNICODE_BOGUS_CHAR_VALUE;
 
 
-        *_str += 6;  /* skip to next possible start of codepoint. */
+        *_str += 5;  /* skip to next possible start of codepoint. */
         return UNICODE_BOGUS_CHAR_VALUE;
         return UNICODE_BOGUS_CHAR_VALUE;
     } /* else if */
     } /* else if */