aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-16 13:19:55 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-16 13:19:55 +0000
commit431774963927a55430e5f5ca217a3fffd558bc19 (patch)
treef806a5ab86df96c57ecdc98a1dcdf4f09619854f
parentUpdate ChangeLog (diff)
downloadw3m-431774963927a55430e5f5ca217a3fffd558bc19.tar.gz
w3m-431774963927a55430e5f5ca217a3fffd558bc19.zip
Truncate large values of table attributes
Bug-Debian: https://github.com/tats/w3m/issues/11
Diffstat (limited to '')
-rw-r--r--file.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/file.c b/file.c
index 7d76b6a..ceabbc1 100644
--- a/file.c
+++ b/file.c
@@ -4998,9 +4998,18 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
}
if (parsedtag_exists(tag, ATTR_HBORDER))
w = BORDER_NOWIN;
+#define MAX_CELLSPACING 1000
+#define MAX_CELLPADDING 1000
+#define MAX_VSPACE 1000
parsedtag_get_value(tag, ATTR_CELLSPACING, &x);
parsedtag_get_value(tag, ATTR_CELLPADDING, &y);
parsedtag_get_value(tag, ATTR_VSPACE, &z);
+ if (x > MAX_CELLSPACING)
+ x = MAX_CELLSPACING;
+ if (y > MAX_CELLPADDING)
+ y = MAX_CELLPADDING;
+ if (z > MAX_VSPACE)
+ z = MAX_VSPACE;
#ifdef ID_EXT
parsedtag_get_value(tag, ATTR_ID, &id);
#endif /* ID_EXT */