commit da3315260b6524a56a2d5d762ae6c910e9955996
parent 66d08bb0a5bc23d1d7a764018e16b9bde15eb776
Author: htrb <htrb>
Date: Fri, 30 Jul 2010 08:57:49 +0000
* [w3m-dev 04348] Re: "important" bugs from bugs.debian.org
* file.c
(TEXTAREA_ATTR_COL_MAX, TEXTAREA_ATTR_ROWS_MAX): added.
(process_textarea): check cur_textarea_size > TEXTAREA_ATTR_COL_MAX and cur_textarea_rows > TEXTAREA_ATTR_ROWS_MAX
Diffstat:
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,8 +1,14 @@
2010-07-30 Ito Hiroyuki <ZXB01226@nifty.com>
+ * [w3m-dev 04348] Re: "important" bugs from bugs.debian.org
+ * file.c (TEXTAREA_ATTR_COL_MAX, TEXTAREA_ATTR_ROWS_MAX): added.
+ (process_textarea): check cur_textarea_size > TEXTAREA_ATTR_COL_MAX and cur_textarea_rows > TEXTAREA_ATTR_ROWS_MAX
+
+2010-07-30 Ito Hiroyuki <ZXB01226@nifty.com>
+
* [w3m-dev 04345] Re: "important" bugs from bugs.debian.org
* file.c (HR_ATTR_WIDTH_MAX): added.
- * file.c (process_hr): check w > HR_ATTR_WIDTH_MAX
+ (process_hr): check w > HR_ATTR_WIDTH_MAX
2010-07-26 d+w3m@vdr.jp
@@ -12,7 +18,7 @@
* cookie.c (check_avoid_wrong_number_of_dots_domain): added.
(add_cookie): use check_avoid_wrong_number_of_dots_domain().
-2010-07-26 Ito Hiroyuki <ZXB01226 at nifty.com>
+2010-07-26 Ito Hiroyuki <ZXB01226@nifty.com>
* acinclude.m4: define AC_W3M_SSL_DIGEST_AUTH
@@ -24,7 +30,7 @@
* main.c (sig_chld): use TRUE and FALSE instead of GRAPHIC_CHAR_ALL and GRAPHIC_CHAR_ASCII.
* merge ambiguous width patch ( http://www.j10n.org/files/w3m-cvs-1.914-ambwidth.patch ).
-2010-07-24 Ito Hiroyuki <ZXB01226 at nifty.com>
+2010-07-24 Ito Hiroyuki <ZXB01226@nifty.com>
* [w3m-dev 04326] suppress compile warnings
* file.c (digest_hex): type of the parameter s is "unsigned char *".
diff --git a/file.c b/file.c
@@ -3914,6 +3914,8 @@ process_textarea(struct parsed_tag *tag, int width)
{
Str tmp = NULL;
char *p;
+#define TEXTAREA_ATTR_COL_MAX 4096
+#define TEXTAREA_ATTR_ROWS_MAX 4096
if (cur_form_id < 0) {
char *s = "<form_int method=internal action=none>";
@@ -3928,14 +3930,20 @@ process_textarea(struct parsed_tag *tag, int width)
cur_textarea_size = atoi(p);
if (p[strlen(p) - 1] == '%')
cur_textarea_size = width * cur_textarea_size / 100 - 2;
- if (cur_textarea_size <= 0)
+ if (cur_textarea_size <= 0) {
cur_textarea_size = 20;
+ } else if (cur_textarea_size > TEXTAREA_ATTR_COL_MAX) {
+ cur_textarea_size = TEXTAREA_ATTR_COL_MAX;
+ }
}
cur_textarea_rows = 1;
if (parsedtag_get_value(tag, ATTR_ROWS, &p)) {
cur_textarea_rows = atoi(p);
- if (cur_textarea_rows <= 0)
+ if (cur_textarea_rows <= 0) {
cur_textarea_rows = 1;
+ } else if (cur_textarea_rows > TEXTAREA_ATTR_ROWS_MAX) {
+ cur_textarea_rows = TEXTAREA_ATTR_ROWS_MAX;
+ }
}
cur_textarea_readonly = parsedtag_exists(tag, ATTR_READONLY);
if (n_textarea >= max_textarea) {