From ee6f535379b157dd33211f7b3fe0527dccfdd99c Mon Sep 17 00:00:00 2001 From: Ito Hiroyuki Date: Fri, 30 Jul 2010 08:50:39 +0000 Subject: * [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 --- file.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index c53077b..936f7be 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.260 2010/07/24 04:30:40 htrb Exp $ */ +/* $Id: file.c,v 1.261 2010/07/30 08:50:39 htrb Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -4008,13 +4008,18 @@ process_hr(struct parsed_tag *tag, int width, int indent_width) Str tmp = Strnew_charp(""); int w = 0; int x = ALIGN_CENTER; +#define HR_ATTR_WIDTH_MAX 65535 if (width > indent_width) width -= indent_width; - if (parsedtag_get_value(tag, ATTR_WIDTH, &w)) + if (parsedtag_get_value(tag, ATTR_WIDTH, &w)) { + if (w > HR_ATTR_WIDTH_MAX) { + w = HR_ATTR_WIDTH_MAX; + } w = REAL_WIDTH(w, width); - else + } else { w = width; + } parsedtag_get_value(tag, ATTR_ALIGN, &x); switch (x) { -- cgit v1.2.3