Fix segfault on bogus text

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820162
This commit is contained in:
Tatsuya Kinoshita
2016-04-07 06:42:55 +09:00
parent 02ba3d6ed6
commit 7bb2a46715
12 changed files with 99 additions and 12 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
/* Big5 (Chinese Taiwan) */
static wc_uint16 big5_ucs_map[ 0x59 * 0x9D ] = {
#define N_big5_ucs_map (0x59 * 0x9D)
static wc_uint16 big5_ucs_map[ N_big5_ucs_map ] = {
0x3000, /* 0xA140 */
0xFF0C, /* 0xA141 */
0x3001, /* 0xA142 */
+6 -2
View File
@@ -1,6 +1,8 @@
/* CNS 11643 (Chinese Taiwan) */
static wc_uint16 cns116431_ucs_map[ 0x5E * 0x5E ] = {
#define N_cns116431_ucs_map (0x5E * 0x5E)
static wc_uint16 cns116431_ucs_map[ N_cns116431_ucs_map ] = {
0x3000, /* 0x2121 */
0xFF0C, /* 0x2122 */
0x3001, /* 0x2123 */
@@ -8839,7 +8841,9 @@ static wc_uint16 cns116431_ucs_map[ 0x5E * 0x5E ] = {
0, /* 0x7E7E */
};
static wc_uint16 cns116432_ucs_map[ 0x5E * 0x5E ] = {
#define N_cns116432_ucs_map (0x5E * 0x5E)
static wc_uint16 cns116432_ucs_map[ N_cns116432_ucs_map ] = {
0x4E42, /* 0x2121 */
0x4E5C, /* 0x2122 */
0x51F5, /* 0x2123 */
+3 -1
View File
@@ -1,6 +1,8 @@
/* GB 12345 (Chinese) */
static wc_uint16 gb12345_ucs_map[ 0x5E * 0x5E ] = {
#define N_gb12345_ucs_map (0x5E * 0x5E)
static wc_uint16 gb12345_ucs_map[ N_gb12345_ucs_map ] = {
0x3000, /* 0x2121 */
0x3001, /* 0x2122 */
0x3002, /* 0x2123 */
+3 -1
View File
@@ -1,6 +1,8 @@
/* GB 2312 (Chinese) */
static wc_uint16 gb2312_ucs_map[ 0x5E * 0x5E ] = {
#define N_gb2312_ucs_map (0x5E * 0x5E)
static wc_uint16 gb2312_ucs_map[ N_gb2312_ucs_map ] = {
0x3000, /* 0x2121 */
0x3001, /* 0x2122 */
0x3002, /* 0x2123 */
+3 -1
View File
@@ -6,7 +6,9 @@ static wc_map ucs_gbk_80_map[ N_ucs_gbk_80_map ] = {
{ 0x20AC, 0x0080 },
};
static wc_uint16 gbk_ucs_map[ 0x7E * 0xBE - 0x5E * 0x5E + 0x0A + 0x16 + 0x06 ] = {
#define N_gbk_ucs_map (0x7E * 0xBE - 0x5E * 0x5E + 0x0A + 0x16 + 0x06)
static wc_uint16 gbk_ucs_map[ N_gbk_ucs_map ] = {
0x4E02, /* 0x8140 */
0x4E04, /* 0x8141 */
0x4E05, /* 0x8142 */
+3 -1
View File
@@ -1,6 +1,8 @@
/* HKSCS (Chinese Hong Kong) */
static wc_uint16 hkscs_ucs_map[ 0x1E * 0x9D ] = {
#define N_hkscs_ucs_map (0x1E * 0x9D)
static wc_uint16 hkscs_ucs_map[ N_hkscs_ucs_map ] = {
0, /* 0x8840 */
0, /* 0x8841 */
0, /* 0x8842 */
+6 -2
View File
@@ -1,6 +1,8 @@
/* JIS X 0208, JIS X 0212, JIS X 0213 (Japanese) */
static wc_uint16 jisx0208x02131_ucs_map[ 0x5E * 0x5E ] = {
#define N_jisx0208x02131_ucs_map (0x5E * 0x5E)
static wc_uint16 jisx0208x02131_ucs_map[ N_jisx0208x02131_ucs_map ] = {
0x3000, /* JIS X 0208 0x2121 */
0x3001, /* JIS X 0208 0x2122 */
0x3002, /* JIS X 0208 0x2123 */
@@ -8839,7 +8841,9 @@ static wc_uint16 jisx0208x02131_ucs_map[ 0x5E * 0x5E ] = {
0, /* JIS X 0213-1 0x7E7E */
};
static wc_uint16 jisx0212x02132_ucs_map[ 0x5E * 0x5E ] = {
#define N_jisx0212x02132_ucs_map (0x5E * 0x5E)
static wc_uint16 jisx0212x02132_ucs_map[ N_jisx0212x02132_ucs_map ] = {
0, /* JIS X 0213-2 0x2121 */
0x4E02, /* JIS X 0213-2 0x2122 */
0x4E0F, /* JIS X 0213-2 0x2123 */
+3 -1
View File
@@ -1,6 +1,8 @@
/* KS X 1001 (Korean) */
static wc_uint16 ksx1001_ucs_map[ 0x5E * 0x5E ] = {
#define N_ksx1001_ucs_map (0x5E * 0x5E)
static wc_uint16 ksx1001_ucs_map[ N_ksx1001_ucs_map ] = {
0x3000, /* 0x2121 */
0x3001, /* 0x2122 */
0x3002, /* 0x2123 */
+3 -1
View File
@@ -1,6 +1,8 @@
/* Shift_JIS/CP932 (Japanese) */
static wc_uint16 sjis_ext_ucs_map[ 0x5E * 10 ] = {
#define N_sjis_ext_ucs_map (0x5E * 10)
static wc_uint16 sjis_ext_ucs_map[ N_sjis_ext_ucs_map ] = {
0x2460, /* 0x8740 */
0x2461, /* 0x8741 */
0x2462, /* 0x8742 */
+3 -1
View File
@@ -1,6 +1,8 @@
/* UHC/CP949 (Korean) */
static wc_uint16 uhc_ucs_map[ 0x20 * 0xB2 + 0x27 * 0x54 + 2 ] = {
#define N_uhc_ucs_map (0x20 * 0xB2 + 0x27 * 0x54 + 2)
static wc_uint16 uhc_ucs_map[ N_uhc_ucs_map ] = {
0xAC02, /* 0x8141 */
0xAC03, /* 0x8142 */
0xAC05, /* 0x8143 */