From 58b26000a214d64f6b3ee1522cbbd7a4e07080a0 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Sat, 3 Apr 2021 19:40:24 +0900 Subject: Limit size and number of tables to prevent integer overflow --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'file.c') 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; -- cgit v1.2.3