Commit Graph

2406 Commits

Author SHA1 Message Date
Rene Kita
cf7058b56c Let base64_encode() take a char *
Throughout the whole code base only char * is passed, but a unsigned
char * is expected. This leads to several warnings.

Fix the interface and cast to unsigned char * internally to avoid any
changes to the behaviour.
2022-02-20 11:14:54 +01:00
Rene Kita
561f27f833 Explicitly cast to unsigned when passing to MD5() 2022-02-20 11:14:54 +01:00
Rene Kita
b25abc595c Let strncpy write the null terminator 2022-02-20 11:14:53 +01:00
Rene Kita
0cd26b92cb Take the correct char type in growbuf_append()
This change removes all warnings (-Wall) from this function.
2022-02-20 11:14:53 +01:00
Rene Kita
ab22479fb3 Fix warning for unused variable w/o MENU_SELECT 2022-02-20 11:14:53 +01:00
Rene Kita
4901408ea5 Fix warning for unused variable without USE_M17N 2022-02-20 11:14:53 +01:00
Rene Kita
916104b7f2 Remove unused variable 2022-02-20 11:14:53 +01:00
Rene Kita
dad5cbe83b Use main(void) when not taking arguments 2022-02-20 11:14:53 +01:00
Rene Kita
84f724a590 Use standard conforming main() definition 2022-02-20 11:14:53 +01:00
Rene Kita
89295504fc Suppress two warnings when compiling with tcc
While there, add some comments to better understand the code flow in
localcgi_post().
2022-02-20 11:14:53 +01:00
Rene Kita
f7601b4555 Move OPTS to end of CFLAGS
This allows the user to override default options.
2022-02-20 11:14:53 +01:00
Tatsuya Kinoshita
64c5cd449a Update ChangeLog 2022-02-19 21:52:16 +09:00
Tatsuya Kinoshita
83df90dc11 Merge pull request #204 from kcwu/improve-fuzz-conv
Improve fuzz-conv fuzzer
2022-02-19 21:47:44 +09:00
Tatsuya Kinoshita
1e858d78af Merge pull request #214 from N-R-K/fix_type_mismatch
fix wc_map_range_search() parameter type mismatch
2022-02-19 21:47:21 +09:00
Tatsuya Kinoshita
32c1ad1783 Merge pull request #218 from rkta/issue199
Check for end of string when parsing Gopher URLs
2022-02-19 21:46:11 +09:00
Rene Kita
ba29eb3fcf Check for end of string when parsing Gopher URLs
This fixes issue #199 reported by Kuang-che Wu.

A specially crafted Gopher URL (e.g. '<a href=gopher:R>') could lead to
an out-of-bounds read.

Problem here was, that 'p' was incremented twice without checking for
the end of the string.

The interesting question for me is: What does this 'if' actually check?
What is special here about the 'R'? I did not find anything related in
RFC 1436 or in RFC 4266.
2022-02-17 12:46:07 +01:00
Tatsuya Kinoshita
53d323453d Update ChangeLog 2022-02-17 00:27:20 +09:00
Tatsuya Kinoshita
1199fb1f36 Merge pull request #217 from rkta/issue200
Ignore tokens that look like HTML, but are not
2022-02-17 00:21:06 +09:00
Tatsuya Kinoshita
3924eb1d73 Merge pull request #215 from rkta/imlib2-config
Do not use imlib2-config
2022-02-17 00:20:29 +09:00
Rene Kita
9874c87ad1 Do not use imlib2-config
imlib2-config was dropped by Imlib2:
https://git.enlightenment.org/legacy/imlib2.git/commit/?id=e9d84bd2163e6fab494b5ce5cc8830a54ff97765

The fixes issue #213.
2022-02-12 13:02:26 +01:00
Rene Kita
4d34f77a4b Ignore tokens that look like HTML, but are not
This patch fixes issue 200 'heap-buffer-overflow in
shiftAnchorPosition'.

Any input that looks like a tag, but isn't, should just be ignored. HTML
is parsed in a two staged process. Stage 1 inserts internal tags (like
<a hseq=...>). Stage 2 assumes these internal tags are valid input
inserted in the previous stage. If we don't throw away non-valid HTML
tags in stage 1 any website can inject tags that are interpreted as
internal ones. This leads to an out-of-bound read in this test case.

The 'hseq=-90' from the input ends as the value (89 actually) of
'a->hseq' in 'anchor.c:555'. Then 'hl->marks[a->hseq]' is out of bounds
as there are only 30 entries in this list.

This is the test input:
<table>0<br <>0<xmp>È«<div><inteRnal><input_alt fid=0><dl>0<dl>0<button value='">0000000000000000000000000000000000000000ÿ000'><A hseq=-90 href=>0<hR align=middle>
2022-02-12 12:37:06 +01:00
NRK
d35241cdbe fix wc_map_range_search() parameter type mismatch
caught by trying to compile on gcc with LTO enabled
2022-02-12 15:33:25 +06:00
Sebastian Rasmussen
29e9832b4b Add Swedish translation. 2022-01-17 18:08:13 +01:00
Yash Lala
26284ff627 Set rc_dir based on W3M_DIR environment variable.
By default, w3m puts all of its data in the `~/.w3m/` directory
(creating it as necessary). This was not configurable in any way.

This commit adds some quick reconfigurability -- when the "W3M_DIR"
environment variable is set, w3m will use that location instead. The
default location is unchanged.

Fixes #130.
2022-01-14 11:06:46 -08:00
Kuang-che Wu
9a1db7459e Improve fuzz-conv fuzzer
Input format
 - Less restriction on input length
 - Input text and charset no longer overlapped
Performance
 - Less memory allocation
 - Less disk IO
 - Do not force GC. This make the fuzzer roughly 10x faster
2021-10-28 17:03:36 +08:00
Tatsuya Kinoshita
2b59b9eb0a Update ChangeLog 2021-10-27 00:45:34 +09:00
Tatsuya Kinoshita
a9efc84292 Merge pull request #203 from kcwu/fix-str-stream-leak
fix StrStream memory leak
2021-10-27 00:39:55 +09:00
Tatsuya Kinoshita
f46aa6769f Merge pull request #202 from bptato/dl
Fix stack overflow due to closing dd tags
2021-10-27 00:39:28 +09:00
Tatsuya Kinoshita
7f8b4f9fcd Merge pull request #197 from rkta/table_vla_size_again
Ensure VLA size is at least one (again)
2021-10-27 00:38:55 +09:00
Kuang-che Wu
b0ebd5737e fix StrStream memory leak
ISclose() doesn't free memory if a stream's function pointer, close, is NULL.
However, str_stream's close pointer is always NULL and thus leaks
memory.
2021-10-26 16:28:37 +08:00
bptato
fa02254a6a Fix description title rendering (again) 2021-10-19 20:37:07 +02:00
bptato
3e5aa3790b Revert changes introducing #198 stack-overflow in HTMLlineproc0 2021-10-19 19:55:58 +02:00
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
Tatsuya Kinoshita
b201f426e4 Update ChangeLog 2021-09-18 20:53:40 +09:00
Tatsuya Kinoshita
b8a443130c Merge pull request #193 from rkta/asn1_string_manipulation
Fix manipulation of ASN1_STRING
2021-09-18 20:52:37 +09:00
Rene Kita
cab914ef48 Fix manipulation of ASN1_STRING
Take the correct type from ASN1_STRING_get0_data() to fix a warning.
IA5Strings are ASCII, we do not need to care about signedness.

Since the pointer returned by ASN1_STRING_get0_data() points to internal
memory of the ASN1_STRING we are not allowed to manipulate the data.
Also it is not guaranteed that the data is null terminated. Copy the
data to our own buffer and make sure it is null terminated before using
it.
2021-09-13 10:04:49 +02:00
Tatsuya Kinoshita
456ec66be8 Update ChangeLog 2021-09-05 18:49:15 +09:00
Tatsuya Kinoshita
ef493bd91a Merge pull request #192 from rkta/table_ensure_vla_size_is_greater_0
Ensure VLA size is at least one
2021-09-05 18:46:11 +09: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
5234c45fa3 Update ChangeLog 2021-08-30 20:20:20 +09:00
Tatsuya Kinoshita
b71c5ec462 Fix incorrect query string for w3mman 7z
Bug-Debian: https://github.com/tats/w3m/issues/191
2021-08-30 20:19:07 +09:00
Tatsuya Kinoshita
0fb72f72ea Update ChangeLog 2021-08-19 19:34:04 +09:00
Tatsuya Kinoshita
e74aa1c96b Merge pull request #189 from augustogunsch/master
Update README.tab
2021-08-19 19:33:01 +09:00
Augusto Gunsch
ac47193ce6 Fix wrong quote character 2021-08-15 15:29:03 -03:00
Augusto Gunsch
0a8a7c7516 Make spacing more consistent 2021-08-15 15:27:27 -03:00
Augusto Gunsch
ecc89bc8b5 Update default tab navigation keybindings 2021-08-15 15:18:54 -03:00
Tatsuya Kinoshita
c87a5476de Update ChangeLog 2021-07-17 13:23:27 +09:00
Tatsuya Kinoshita
283ed66937 Enable Italian translation 2021-07-17 13:20:55 +09:00
Tatsuya Kinoshita
7271fbf0ad Update PO information 2021-07-17 13:20:36 +09:00
Tatsuya Kinoshita
7197874a4b Merge pull request #187 from scardracs/master
Add italian translation
2021-07-17 13:16:57 +09:00