From 966fc976cf1aae9cc48cb48189b168902a690eb1 Mon Sep 17 00:00:00 2001 From: Ito Hiroyuki Date: Fri, 30 Jul 2010 08:57:49 +0000 Subject: * [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 --- ChangeLog | 14 ++++++++++---- file.c | 14 +++++++++++--- 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 + + * [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 * [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 +2010-07-26 Ito Hiroyuki * 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 +2010-07-24 Ito Hiroyuki * [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 #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 = ""; @@ -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) { -- cgit v1.2.3