Ver código fonte

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 meses atrás
pai
commit
8a90802778
1 arquivos alterados com 1 adições e 1 exclusões
  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? */
             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;
     } /* else if */