aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIto Hiroyuki <ZXB01226@nifty.com>2010-07-30 08:57:49 +0000
committerIto Hiroyuki <ZXB01226@nifty.com>2010-07-30 08:57:49 +0000
commit966fc976cf1aae9cc48cb48189b168902a690eb1 (patch)
treeca7a3874307662568dc997adf042fa7a8b672087
parent* [w3m-dev 04345] Re: "important" bugs from bugs.debian.org (diff)
downloadw3m-966fc976cf1aae9cc48cb48189b168902a690eb1.tar.gz
w3m-966fc976cf1aae9cc48cb48189b168902a690eb1.zip
* [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 (limited to '')
-rw-r--r--ChangeLog14
-rw-r--r--file.c14
2 files changed, 21 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d50b21..64dcc6d 100644
--- 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 *".
@@ -9067,4 +9073,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.1022 2010/07/30 08:50:39 htrb Exp $
+$Id: ChangeLog,v 1.1023 2010/07/30 08:57:49 htrb Exp $
diff --git a/file.c b/file.c
index 936f7be..49664d6 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.261 2010/07/30 08:50:39 htrb Exp $ */
+/* $Id: file.c,v 1.262 2010/07/30 08:57:49 htrb Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -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) {