1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash when using a large Unicode character in a file that has
12 syntax highlighting. (ngollan)
13 Solution: Check for going past the end of the utf tables. (Dominique Pelle)
17 *** ../vim-7.3.364/src/mbyte.c 2011-08-10 13:21:30.000000000 +0200
18 --- src/mbyte.c 2011-12-08 15:09:13.000000000 +0100
23 int start, mid, end; /* indices into table */
26 ! end = tableSize / sizeof(convertStruct);
29 /* need to search further */
30 ! mid = (end + start) /2;
31 if (table[mid].rangeEnd < a)
36 ! if (table[start].rangeStart <= a && a <= table[start].rangeEnd
37 && (a - table[start].rangeStart) % table[start].step == 0)
38 return (a + table[start].offset);
43 int start, mid, end; /* indices into table */
44 + int entries = tableSize / sizeof(convertStruct);
50 /* need to search further */
51 ! mid = (end + start) / 2;
52 if (table[mid].rangeEnd < a)
58 ! && table[start].rangeStart <= a
59 ! && a <= table[start].rangeEnd
60 && (a - table[start].rangeStart) % table[start].step == 0)
61 return (a + table[start].offset);
68 ! return utf_convert(a, foldCase, sizeof(foldCase));
71 static convertStruct toLower[] =
76 ! return utf_convert(a, foldCase, (int)sizeof(foldCase));
79 static convertStruct toLower[] =
82 return TOUPPER_LOC(a);
84 /* For any other characters use the above mapping table. */
85 ! return utf_convert(a, toUpper, sizeof(toUpper));
90 return TOUPPER_LOC(a);
92 /* For any other characters use the above mapping table. */
93 ! return utf_convert(a, toUpper, (int)sizeof(toUpper));
99 return TOLOWER_LOC(a);
101 /* For any other characters use the above mapping table. */
102 ! return utf_convert(a, toLower, sizeof(toLower));
107 return TOLOWER_LOC(a);
109 /* For any other characters use the above mapping table. */
110 ! return utf_convert(a, toLower, (int)sizeof(toLower));
114 *** ../vim-7.3.364/src/version.c 2011-12-01 20:59:16.000000000 +0100
115 --- src/version.c 2011-12-08 15:07:53.000000000 +0100
119 { /* Add new patch number below this line */
125 Hear about the guy who played a blank tape at full blast?
126 The mime next door went nuts.
128 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
129 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
130 \\\ an exciting new programming language -- http://www.Zimbu.org ///
131 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///