diffstat for w3m-0.5.3 w3m-0.5.3 changelog | 42 +++++ patches/901_ucsmap.patch | 292 +++++++++++++++++++++++++++++++++++++++++ patches/902_johab1.patch | 22 +++ patches/903_input-type.patch | 35 ++++ patches/904_form-update.patch | 19 ++ patches/905_textarea.patch | 75 ++++++++++ patches/906_form-update.patch | 21 ++ patches/907_iso2022.patch | 63 ++++++++ patches/908_forms.patch | 28 +++ patches/909_button-type.patch | 27 +++ patches/910_input-alt.patch | 22 +++ patches/911_rowcolspan.patch | 26 +++ patches/912_i-dd.patch | 34 ++++ patches/913_tabwidth.patch | 20 ++ patches/914_curline.patch | 18 ++ patches/915_table-alt.patch | 18 ++ patches/916_anchor.patch | 19 ++ patches/917_strgrow.patch | 20 ++ patches/918_form-value.patch | 22 +++ patches/919_form-update.patch | 27 +++ patches/920_table.patch | 60 ++++++++ patches/921_cotable.patch | 18 ++ patches/922_lineproc.patch | 28 +++ patches/923_tagproc.patch | 22 +++ patches/924_curline.patch | 19 ++ patches/925_lineproc.patch | 45 ++++++ patches/926_indent-level.patch | 18 ++ patches/927_symbol.patch | 74 ++++++++++ patches/928_form-id.patch | 28 +++ patches/929_anchor.patch | 18 ++ patches/930_tbl-mode.patch | 33 ++++ patches/931_parse-url.patch | 21 ++ patches/932_ucsmap.patch | 72 ++++++++++ patches/series | 32 ++++ 34 files changed, 1338 insertions(+) diff -Nru w3m-0.5.3/debian/changelog w3m-0.5.3/debian/changelog --- w3m-0.5.3/debian/changelog 2014-10-21 22:50:57.000000000 +0900 +++ w3m-0.5.3/debian/changelog 2016-11-22 00:34:52.000000000 +0900 @@ -1,3 +1,45 @@ +w3m (0.5.3-19+deb8u1) jessie; urgency=medium + + * New patch 901_ucsmap.patch to fix array index (closes: #820162) + * New patch 902_johab1.patch to fix array index (closes: #820373) + * New patch 903_input-type.patch to fix null deref [CVE-2016-9430] + * New patch 904_form-update.patch to fix overflow + [CVE-2016-9423] [CVE-2016-9431] + * New patch 905_textarea.patch to fix heap write [CVE-2016-9424] + * New patch 906_form-update.patch to fix bcopy size [CVE-2016-9432] + * New patch 907_iso2022.patch to fix array index [CVE-2016-9433] + * New patch 908_forms.patch to fix null deref [CVE-2016-9434] + * New patch 909_button-type.patch to fix rodata write [CVE-2016-9437] + * New patch 910_input-alt.patch to fix null deref [CVE-2016-9438] + * New patch 911_rowcolspan.patch to fix stack smashing [CVE-2016-9422] + * New patch 912_i-dd.patch to fix uninit values + [CVE-2016-9435] [CVE-2016-9436] + * New patch 913_tabwidth.patch to fix heap corruption [CVE-2016-9426] + * New patch 914_curline.patch to fix near-null deref [CVE-2016-9440] + * New patch 915_table-alt.patch to fix near-null deref [CVE-2016-9441] + * New patch 916_anchor.patch to fix heap write + [CVE-2016-9425] [CVE-2016-9428] + * New patch 917_strgrow.patch to fix potential heap buffer corruption + [CVE-2016-9442] + * New patch 918_form-value.patch to fix null deref [CVE-2016-9443] + * New patch 919_form-update.patch to fix buffer overflow [CVE-2016-9429] + * New patch 920_table.patch to fix stack overflow [CVE-2016-9439] + (closes: #844726) + * New patch 921_cotable.patch to fix null deref + * New patch 922_lineproc.patch to fix null deref + * New patch 923_tagproc.patch to fix negative size allocation + * New patch 924_curline.patch to fix near-null deref + * New patch 925_lineproc.patch to fix stack overflow + * New patch 926_indent-level.patch to fix stack overflow + * New patch 927_symbol.patch to fix array index + * New patch 928_form-id.patch to fix null deref + * New patch 929_anchor.patch to fix null deref + * New patch 930_tbl-mode.patch to fix null deref + * New patch 931_parse-url.patch to fix global-buffer-overflow + * New patch 932_ucsmap.patch to fix global-buffer-overflow + + -- Tatsuya Kinoshita Tue, 22 Nov 2016 00:34:52 +0900 + w3m (0.5.3-19) unstable; urgency=medium * New patch 360_lang-de.patch to add German translation (closes: #763964) diff -Nru w3m-0.5.3/debian/patches/901_ucsmap.patch w3m-0.5.3/debian/patches/901_ucsmap.patch --- w3m-0.5.3/debian/patches/901_ucsmap.patch 1970-01-01 09:00:00.000000000 +0900 +++ w3m-0.5.3/debian/patches/901_ucsmap.patch 2016-11-21 23:02:33.000000000 +0900 @@ -0,0 +1,292 @@ +Subject: Fix segfault on bogus text +Author: Tatsuya Kinoshita +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820162 +Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=7bb2a4671503c41d63989dcef9ef54dea0c73b43 +Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1324348 + +cf. https://lists.fedoraproject.org/pipermail/package-announce/2016-April/182697.html + +diff --git a/libwc/map/big5_ucs.map b/libwc/map/big5_ucs.map +index 0c6fd12..ac817a9 100644 +--- a/libwc/map/big5_ucs.map ++++ b/libwc/map/big5_ucs.map +@@ -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 */ +diff --git a/libwc/map/cns11643_ucs.map b/libwc/map/cns11643_ucs.map +index b426dd3..fcba334 100644 +--- a/libwc/map/cns11643_ucs.map ++++ b/libwc/map/cns11643_ucs.map +@@ -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 */ +diff --git a/libwc/map/gb12345_ucs.map b/libwc/map/gb12345_ucs.map +index 55558c7..3fb338d 100644 +--- a/libwc/map/gb12345_ucs.map ++++ b/libwc/map/gb12345_ucs.map +@@ -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 */ +diff --git a/libwc/map/gb2312_ucs.map b/libwc/map/gb2312_ucs.map +index 38fb88f..3d37465 100644 +--- a/libwc/map/gb2312_ucs.map ++++ b/libwc/map/gb2312_ucs.map +@@ -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 */ +diff --git a/libwc/map/gbk_ucs.map b/libwc/map/gbk_ucs.map +index 5a0d5ba..d092fd7 100644 +--- a/libwc/map/gbk_ucs.map ++++ b/libwc/map/gbk_ucs.map +@@ -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 */ +diff --git a/libwc/map/hkscs_ucs.map b/libwc/map/hkscs_ucs.map +index 96d1566..2fbe6b4 100644 +--- a/libwc/map/hkscs_ucs.map ++++ b/libwc/map/hkscs_ucs.map +@@ -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 */ +diff --git a/libwc/map/jisx0208x0212x0213_ucs.map b/libwc/map/jisx0208x0212x0213_ucs.map +index 1a1d706..28c2a6c 100644 +--- a/libwc/map/jisx0208x0212x0213_ucs.map ++++ b/libwc/map/jisx0208x0212x0213_ucs.map +@@ -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 */ +diff --git a/libwc/map/ksx1001_ucs.map b/libwc/map/ksx1001_ucs.map +index 9a17d61..cb62f98 100644 +--- a/libwc/map/ksx1001_ucs.map ++++ b/libwc/map/ksx1001_ucs.map +@@ -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 */ +diff --git a/libwc/map/sjis_ext_ucs.map b/libwc/map/sjis_ext_ucs.map +index a82995c..cc748ba 100644 +--- a/libwc/map/sjis_ext_ucs.map ++++ b/libwc/map/sjis_ext_ucs.map +@@ -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 */ +diff --git a/libwc/map/uhc_ucs.map b/libwc/map/uhc_ucs.map +index b6b43ca..55efc09 100644 +--- a/libwc/map/uhc_ucs.map ++++ b/libwc/map/uhc_ucs.map +@@ -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 */ +diff --git a/libwc/ucs.c b/libwc/ucs.c +index d7b6948..061e1ce 100644 +--- a/libwc/ucs.c ++++ b/libwc/ucs.c +@@ -108,6 +108,7 @@ wc_any_to_ucs(wc_wchar_t cc) + { + int f; + wc_uint16 *map = NULL; ++ wc_uint32 map_size = 0x80; + wc_map *map2; + + f = WC_CCS_INDEX(cc.ccs); +@@ -138,6 +139,7 @@ wc_any_to_ucs(wc_wchar_t cc) + if (f < WC_F_ISO_BASE || f > WC_F_CS94W_END) + return 0; + map = cs94w_ucs_map[f - WC_F_ISO_BASE]; ++ map_size = cs94w_ucs_map_size[f - WC_F_ISO_BASE]; + cc.code = WC_CS94W_N(cc.code); + break; + case WC_CCS_A_CS96: +@@ -150,6 +152,7 @@ wc_any_to_ucs(wc_wchar_t cc) + if (f < WC_F_ISO_BASE || f > WC_F_CS96W_END) + return WC_C_UCS4_ERROR; + map = cs96w_ucs_map[f - WC_F_ISO_BASE]; ++ map_size = cs96w_ucs_map_size[f - WC_F_ISO_BASE]; + cc.code = WC_CS96W_N(cc.code); + break; + case WC_CCS_A_CS942: +@@ -180,6 +183,7 @@ wc_any_to_ucs(wc_wchar_t cc) + if (f < WC_F_PCS_BASE || f > WC_F_PCSW_END) + return WC_C_UCS4_ERROR; + map = pcsw_ucs_map[f - WC_F_PCS_BASE]; ++ map_size = pcsw_ucs_map_size[f - WC_F_PCS_BASE]; + switch (cc.ccs) { + case WC_CCS_BIG5: + cc.code = WC_BIG5_N(cc.code); +@@ -271,6 +275,8 @@ wc_any_to_ucs(wc_wchar_t cc) + } + if (map == NULL) + return WC_C_UCS4_ERROR; ++ if (map_size == 0 || cc.code > map_size - 1) ++ return WC_C_UCS4_ERROR; + cc.code = map[cc.code]; + return cc.code ? cc.code : WC_C_UCS4_ERROR; + } +diff --git a/libwc/ucs.map b/libwc/ucs.map +index dfac6d9..5d6f688 100644 +--- a/libwc/ucs.map ++++ b/libwc/ucs.map +@@ -195,7 +195,28 @@ static wc_uint16 *cs94w_ucs_map[] = { + jisx0212x02132_ucs_map, /* 50 (JIS X 0213-2) */ + }; + ++static wc_uint32 cs94w_ucs_map_size[] = { ++ N_jisx0208x02131_ucs_map, /* 40 (JIS C 6226) */ ++ N_gb2312_ucs_map, /* 41 (GB 2312) */ ++ N_jisx0208x02131_ucs_map, /* 42 (JIS X 0208) */ ++ N_ksx1001_ucs_map, /* 43 (KS X 1001) */ ++ N_jisx0212x02132_ucs_map, /* 44 (JIS X 0212) */ ++ 0, /* 45 (ISO IR 165) */ ++ 0, /* 46 */ ++ N_cns116431_ucs_map, /* 47 (CNS 11643-1) */ ++ N_cns116432_ucs_map, /* 48 (CNS 11643-2) */ ++ 0, /* 49 (CNS 11643-3) */ ++ 0, /* 4A (CNS 11643-4) */ ++ 0, /* 4B (CNS 11643-5) */ ++ 0, /* 4C (CNS 11643-6) */ ++ 0, /* 4D (CNS 11643-7) */ ++ 0, /* 4E (KSP 9566) */ ++ N_jisx0208x02131_ucs_map, /* 4F (JIS X 0213-1) */ ++ N_jisx0212x02132_ucs_map, /* 50 (JIS X 0213-2) */ ++}; ++ + static wc_uint16 **cs96w_ucs_map; ++static wc_uint32 *cs96w_ucs_map_size; + + static wc_uint16 *pcsw_ucs_map[] = { + big5_ucs_map, /* Big5 */ +@@ -233,6 +254,42 @@ static wc_uint16 *pcsw_ucs_map[] = { + hkscs_ucs_map, /* HKSCS-2 */ + }; + ++static wc_uint32 pcsw_ucs_map_size[] = { ++ N_big5_ucs_map, /* Big5 */ ++ N_big5_ucs_map, /* Big5-1 */ ++ N_big5_ucs_map, /* Big5-2 */ ++ 0, /* CNS 11643-8 */ ++ 0, /* CNS 11643-9 */ ++ 0, /* CNS 11643-10 */ ++ 0, /* CNS 11643-11 */ ++ 0, /* CNS 11643-12 */ ++ 0, /* CNS 11643-13 */ ++ 0, /* CNS 11643-14 */ ++ 0, /* CNS 11643-15 */ ++ 0, /* CNS 11643-16 */ ++ 0, /* CNS 11643-X */ ++ N_gb12345_ucs_map, /* GB 12345 */ ++ 0, /* Johab (special conversion) */ ++ 0, /* Johab-1 (special conversion) */ ++ 0, /* Johab-2 (special conversion) */ ++ N_ksx1001_ucs_map, /* Johab-3 */ ++ N_sjis_ext_ucs_map, /* Shift_JIS(CP932) ext */ ++ N_sjis_ext_ucs_map, /* Shift_JIS(CP932) ext-1 */ ++ N_sjis_ext_ucs_map, /* Shift_JIS(CP932) ext-2 */ ++ N_gbk_ucs_map, /* GBK(CP936) */ ++ N_gbk_ucs_map, /* GBK(CP936)-1 */ ++ N_gbk_ucs_map, /* GBK(CP936)-2 */ ++ 0, /* GB18030 GBK-ext (special conversion) */ ++ 0, /* GB18030 GBK-ext-1 (special conversion) */ ++ 0, /* GB18030 GBK-ext-2 (special conversion) */ ++ N_uhc_ucs_map, /* UHC(CP949) */ ++ N_uhc_ucs_map, /* UHC(CP949)-1 */ ++ N_uhc_ucs_map, /* UHC(CP949)-2 */ ++ N_hkscs_ucs_map, /* HKSCS */ ++ N_hkscs_ucs_map, /* HKSCS-1 */ ++ N_hkscs_ucs_map, /* HKSCS-2 */ ++}; ++ + static wc_wchar_t + ucs_cs94_conv(wc_ccs ccs, wc_uint16 c) + { diff -Nru w3m-0.5.3/debian/patches/902_johab1.patch w3m-0.5.3/debian/patches/902_johab1.patch --- w3m-0.5.3/debian/patches/902_johab1.patch 1970-01-01 09:00:00.000000000 +0900 +++ w3m-0.5.3/debian/patches/902_johab1.patch 2016-11-21 23:02:59.000000000 +0900 @@ -0,0 +1,22 @@ +Subject: Fix segfault on bogus text for wc_N_to_johab1 +Author: Tatsuya Kinoshita +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820373 +Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=5a159af05d8556a3f9f8f1a42d8fc153ffbc9694 + +diff --git a/libwc/johab.c b/libwc/johab.c +index 8d587b8..498b1bb 100644 +--- a/libwc/johab.c ++++ b/libwc/johab.c +@@ -160,9 +160,9 @@ wc_N_to_johab1(wc_uint32 code) + { + wc_uint32 a, b, c; + +- a = N_johab1_map[0][(code / 28) / 21]; +- b = N_johab1_map[1][(code / 28) % 21]; +- c = N_johab1_map[2][ code % 28 ]; ++ a = N_johab1_map[0][(code / 28) / 21 & 0x1F]; ++ b = N_johab1_map[1][(code / 28) % 21 & 0x1F]; ++ c = N_johab1_map[2][ code % 28 & 0x1F]; + return 0x8000 | (a << 10) | (b << 5) | c; + } + diff -Nru w3m-0.5.3/debian/patches/903_input-type.patch w3m-0.5.3/debian/patches/903_input-type.patch --- w3m-0.5.3/debian/patches/903_input-type.patch 1970-01-01 09:00:00.000000000 +0900 +++ w3m-0.5.3/debian/patches/903_input-type.patch 2016-11-21 23:03:01.000000000 +0900 @@ -0,0 +1,35 @@ +Subject: Prevent segfault with malformed input type +Author: Tatsuya Kinoshita +Bug-Debian: https://github.com/tats/w3m/issues/7 [CVE-2016-9430] +Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=59b91cd8e30c86f23476fa81ae005cabff49ebb6 + +diff --git a/file.c b/file.c +index 1e363d0..d06b2cf 100644 +--- a/file.c ++++ b/file.c +@@ -3622,9 +3622,10 @@ process_input(struct parsed_tag *tag) + Strcat(tmp, getLinkNumberStr(0)); + Strcat_char(tmp, '('); + } +- Strcat(tmp, Sprintf(""); +- Strcat(tmp, Sprintf("", +- cur_hseq++, cur_form_id, p, html_quote(r), qq)); ++ cur_hseq++, cur_form_id, html_quote(p), ++ html_quote(r), qq)); + return tmp; + } + diff -Nru w3m-0.5.3/debian/patches/904_form-update.patch w3m-0.5.3/debian/patches/904_form-update.patch --- w3m-0.5.3/debian/patches/904_form-update.patch 1970-01-01 09:00:00.000000000 +0900 +++ w3m-0.5.3/debian/patches/904_form-update.patch 2016-11-21 23:03:33.000000000 +0900 @@ -0,0 +1,19 @@ +Subject: Prevent segfault for formUpdateBuffer +Author: Tatsuya Kinoshita +Bug-Debian: https://github.com/tats/w3m/issues/9 [CVE-2016-9423] +Bug-Debian: https://github.com/tats/w3m/issues/10 [CVE-2016-9431] +Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=9f0bdcfdf061db3520bd1f112bdc5e83acdec4be + +diff --git a/form.c b/form.c +index 62b568e..87a5d49 100644 +--- a/form.c ++++ b/form.c +@@ -477,6 +477,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) + spos = a->start.pos; + epos = a->end.pos; + } ++ if (a->start.line != a->end.line || spos > epos) ++ epos = spos; + pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col, + rows > 1, + form->type == FORM_INPUT_PASSWORD); diff -Nru w3m-0.5.3/debian/patches/905_textarea.patch w3m-0.5.3/debian/patches/905_textarea.patch --- w3m-0.5.3/debian/patches/905_textarea.patch 1970-01-01 09:00:00.000000000 +0900 +++ w3m-0.5.3/debian/patches/905_textarea.patch 2016-11-21 23:03:33.000000000 +0900 @@ -0,0 +1,75 @@ +Subject: Prevent negative array index for selectnumber and textareanumber +Author: Tatsuya Kinoshita +Bug-Debian: https://github.com/tats/w3m/issues/12 [CVE-2016-9424] +Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=a25fd09f74fb83499396935a96d63bb7cb8e2c58 + +diff --git a/file.c b/file.c +index d06b2cf..4056393 100644 +--- a/file.c ++++ b/file.c +@@ -67,7 +67,7 @@ static int cur_status; + #ifdef MENU_SELECT + /* menu based