4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Incomplete utf-8 byte sequence is not checked for validity.
12 Solution: Check the bytes that are present for being valid. (Ben Schmidt)
16 *** ../vim-7.1.201/src/mbyte.c Thu Aug 30 13:51:52 2007
17 --- src/mbyte.c Fri Jan 4 17:30:16 2008
20 * Get the length of UTF-8 byte sequence "p[size]". Does not include any
21 * following composing characters.
23 ! * Returns 1 for an illegal byte sequence.
24 * Returns number > "size" for an incomplete byte sequence.
28 * Get the length of UTF-8 byte sequence "p[size]". Does not include any
29 * following composing characters.
31 ! * Returns 1 for an illegal byte sequence (also in incomplete byte seq.).
32 * Returns number > "size" for an incomplete byte sequence.
43 ! len = utf8len_tab[*p];
45 ! return len; /* incomplete byte sequence. */
46 ! for (i = 1; i < len; ++i)
47 if ((p[i] & 0xc0) != 0x80)
58 ! m = len = utf8len_tab[*p];
60 ! m = size; /* incomplete byte sequence. */
61 ! for (i = 1; i < m; ++i)
62 if ((p[i] & 0xc0) != 0x80)
65 *** ../vim-7.1.201/src/version.c Fri Jan 4 16:30:40 2008
66 --- src/version.c Fri Jan 4 17:45:33 2008
70 { /* Add new patch number below this line */
76 A computer programmer is a device for turning requirements into
77 undocumented features. It runs on cola, pizza and Dilbert cartoons.
80 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
81 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
82 \\\ download, build and distribute -- http://www.A-A-P.org ///
83 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///