aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-04-03 10:40:24 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-04-03 10:40:24 +0000
commit58b26000a214d64f6b3ee1522cbbd7a4e07080a0 (patch)
tree6ea40276e78db668807a4ed5246a899eba255670 /file.c
parentUpdate ChangeLog (diff)
downloadw3m-58b26000a214d64f6b3ee1522cbbd7a4e07080a0.tar.gz
w3m-58b26000a214d64f6b3ee1522cbbd7a4e07080a0.zip
Limit size and number of tables to prevent integer overflow
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 55f115a..8718dd3 100644
--- a/file.c
+++ b/file.c
@@ -5107,9 +5107,9 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
return 1;
case HTML_TABLE:
close_anchor(h_env, obuf);
- obuf->table_level++;
- if (obuf->table_level >= MAX_TABLE)
+ if (obuf->table_level + 1 >= MAX_TABLE)
break;
+ obuf->table_level++;
w = BORDER_NONE;
/* x: cellspacing, y: cellpadding */
x = 2;