Commit Graph

33 Commits

Author SHA1 Message Date
Rene Kita
e9f5910f1f Ensure VLA size is at least one (again)
This is the same issue as commit 12c7b62a42 and should have been
included there.

'maxcol' can be -1 which results in a size of 0. The array is never
accessed with 'maxcol < 0', but zero length variable length arrays are
undefined behaviour.
2021-10-04 10:00:04 +02:00
Rene Kita
12c7b62a42 Ensure VLA size is at least one
Compiling with GCC 10.2 with -fsanitize=address,undefined valgrind
and opening the 'opions panel' reports:
table.c:1632:8: runtime error: variable length array bound evaluates to non-positive value 0
table.c:1266:11: runtime error: variable length array bound evaluates to non-positive value 0
table.c:1267:12: runtime error: variable length array bound evaluates to non-positive value 0

'maxcell' is initialized to -1 which results in a size of 0 during the
first iteration. Though the array is only accessed if maxcell >= 0,
using a variable length array with a size < 1 is undefined behaviour
(see e.g. C99 6.7.5.2,p5).

This closes issue #51 .
2021-09-02 10:32:44 +02:00
Tatsuya Kinoshita
c3784c9d26 New option disable_center to disable center alignment
Bug-Debian: https://github.com/tats/w3m/issues/175
Bug-Debian: https://github.com/tats/w3m/issues/185
2021-07-03 15:00:18 +09:00
Tatsuya Kinoshita
58b26000a2 Limit size and number of tables to prevent integer overflow 2021-04-03 19:40:24 +09:00
Tatsuya Kinoshita
540eb60fdd Treat table height as int instead of short
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838952
2021-03-30 22:48:53 +09:00
Tatsuya Kinoshita
73302179ea Respect simple_preserve_space for table cells
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893902
2018-03-24 06:26:30 +09:00
Tatsuya Kinoshita
8354763b90 Prevent negative indent value in feed_table_block_tag()
Bug-Debian: https://github.com/tats/w3m/issues/88
2018-01-20 21:31:03 +09:00
Tatsuya Kinoshita
2124693540 Revert "Prevent overflow beyond the end of string in visible_length()"
This reverts commit a932f78a6d.
2016-12-15 22:53:04 +09:00
Tatsuya Kinoshita
6622b6520a Revert "Prevent overflow beyond the end of string in skip_space()"
This reverts commit e757b43bcf.
2016-12-15 22:52:05 +09:00
Tatsuya Kinoshita
3cb0915076 Revert "Prevent overflow beyond the end of string in visible_length_plain()"
This reverts commit f763b8ebf5.
2016-12-15 22:45:48 +09:00
Tatsuya Kinoshita
f763b8ebf5 Prevent overflow beyond the end of string in visible_length_plain()
Bug-Debian: https://github.com/tats/w3m/issues/76
2016-12-10 18:18:58 +09:00
Tatsuya Kinoshita
e757b43bcf Prevent overflow beyond the end of string in skip_space()
Bug-Debian: https://github.com/tats/w3m/issues/74
2016-12-08 23:51:09 +09:00
Tatsuya Kinoshita
a932f78a6d Prevent overflow beyond the end of string in visible_length()
Bug-Debian: https://github.com/tats/w3m/issues/73
2016-12-08 23:46:30 +09:00
Tatsuya Kinoshita
30b0c97167 Prevent array index out of bounds for tridvalue in feed_table_tag()
Bug-Debian: https://github.com/tats/w3m/issues/71
2016-12-05 22:36:58 +09:00
Tatsuya Kinoshita
a3ed914b0c Prevent negative array index in set_integered_width()
Bug-Debian: https://github.com/tats/w3m/issues/70
2016-12-05 22:25:14 +09:00
Tatsuya Kinoshita
a6ddc331e9 Prevent array index out of bounds for tabattr in feed_table_tag()
Bug-Debian: https://github.com/tats/w3m/issues/60
2016-12-05 22:05:07 +09:00
Tatsuya Kinoshita
ec99f18638 Prevent deref null pointer in renderCoTable()
Bug-Debian: https://github.com/tats/w3m/issues/20#issuecomment-260649537
2016-11-15 23:59:57 +09:00
Tatsuya Kinoshita
2a4a2fb9f1 Prevent infinite recursion with nested table and textarea
Bug-Debian: https://github.com/tats/w3m/issues/20#issuecomment-260590257
2016-11-15 20:11:52 +09:00
Tatsuya Kinoshita
61e50c5faf Revert "Prevent infinite recursion with nested table and textarea"
This reverts commit f393faf559.
2016-11-15 19:52:27 +09:00
Tatsuya Kinoshita
f393faf559 Prevent infinite recursion with nested table and textarea
Bug-Debian: https://github.com/tats/w3m/issues/20
2016-11-12 22:50:01 +09:00
Tatsuya Kinoshita
e458def067 Check indent_level to prevent infinite recursion
Bug-Debian: https://github.com/tats/w3m/issues/37
2016-11-09 23:30:32 +09:00
Tatsuya Kinoshita
6f1454580d Revert "Treat table height as int instead of short"
This reverts commit 0c9aebb26a.
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842623
2016-10-31 20:22:26 +09:00
Tatsuya Kinoshita
0c9aebb26a Treat table height as int instead of short
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838952
2016-10-08 10:27:41 +09:00
Tatsuya Kinoshita
a625766382 Prevent segfault with malformed table_alt
Bug-Debian: https://github.com/tats/w3m/issues/24
2016-08-24 19:05:58 +09:00
Tatsuya Kinoshita
b910f0966d Truncate max_width for renderTable
Bug-Debian: https://github.com/tats/w3m/issues/25
2016-08-24 19:05:58 +09:00
Kuang-che Wu
67a3db378f Fix table rowspan and colspan
Origin: https://github.com/tats/w3m/pull/19
Bug-Debian: https://github.com/tats/w3m/issues/8
2016-08-18 19:35:41 +09:00
David Crosby
85fe990642 Fix stack overflow found by @kcwu 2015-09-06 20:58:20 +09:00
David Crosby
6fe9e524af Initialize new_tabwidth at declaration 2015-08-11 21:59:27 +09:00
David Crosby
7e5b33c30e Remove dead assignments flagged by Clang static analysis 2015-08-11 21:59:27 +09:00
Tatsuya Kinoshita
6a032f360b Support the button element as defined in HTML 4.01
Patch from upstream, [w3m-dev 04411] on 2010-09-17, to support the
button element.  It is discussed upstream and incomplete, but enough
to login Launchpad.
2011-06-19 20:40:17 +09:00
Tatsuya Kinoshita
5397d09e58 Adding upstream version 0.5.3 2011-05-04 16:41:45 +09:00
Tatsuya Kinoshita
6db339b3d7 Adding upstream version 0.5.2 2011-05-04 16:23:02 +09:00
Tatsuya Kinoshita
72f72d64a4 Adding upstream version 0.5.1 2011-05-04 16:05:14 +09:00