From 97595792837e5c10843ab1e547403fce86f67a5a Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Sun, 25 Dec 2022 11:52:08 +0100 Subject: [PATCH 1/4] Don't error out on deprecated declaration warnings The function `unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)` from OpenSSL is deprecated and therefore generates lots of warnings in the build when compiling against OpenSSL 3.0. Do not treat these warnings as errors, but keep the warning active. This should be reverted once OpenSSL-3.0 support arrives. --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36dac15..34d7801 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,4 +23,6 @@ jobs: run: ./configure --enable-alarm --enable-ansi_color --enable-color --enable-cookie --enable-external_uri_loader --enable-gopher --enable-image --enable-ipv6 --enable-m17n --enable-menu --enable-mouse --enable-nls --enable-nntp --enable-sslverify --enable-unicode --enable-w3mmailer --with-imagelib=imlib2 --with-migemo="cmigemo -q -d /usr/share/cmigemo/utf-8/migemo-dict" --with-ssl --with-gc - name: build - run: OPTS='-Wno-unused-result -Werror' make + # TODO(rkta): Remove -Wno-error=deprecated-declarations once support for + # OpenSSL 3.0 has arrived. + run: make OPTS='-Werror -Wno-error=deprecated-declarations -Wno-unused-result' From e6b8a4e2509fe058340fcadde1f3f9e9834f5830 Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Sat, 3 Sep 2022 11:59:53 +0200 Subject: [PATCH 2/4] Fix potential null pointer dereference Found when compiling with '-O3 -flto'. --- file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file.c b/file.c index 371ca97..3d71a8d 100644 --- a/file.c +++ b/file.c @@ -8199,6 +8199,8 @@ save2tmp(URLFile uf, char *tmpf) int check = 0; if (uf.scheme == SCM_NEWS) { char c; + if (!uf.stream) + return -1; while (c = UFgetc(&uf), !iseos(uf.stream)) { if (c == '\n') { if (check == 0) From a2ce4d8acef2c790671f353651840927b9b75681 Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Wed, 22 Dec 2021 19:50:55 +0100 Subject: [PATCH 3/4] Remove a warning for bzero with GCC 12 GCC 12.2.0 on Arch reports: .table.c: In function ???set_table_matrix0???: .table.c:3536:5: error: ???__builtin_memset??? specified size between 18446744071562067969 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] lto1: all warnings being treated as errors lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status child exited with value 1 make: *** [Makefile:132: w3m] Error 1 --- table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table.c b/table.c index 043df86..7479a82 100644 --- a/table.c +++ b/table.c @@ -3503,7 +3503,7 @@ correct_table_matrix4(struct table *t, int col, int cspan, char *flags, static void set_table_matrix0(struct table *t, int maxwidth) { - int size = t->maxcol + 1; + size_t size = t->maxcol + 1; int i, j, k, bcol, ecol; int width; double w0, w1, w, s, b; From 7078c78443b13b5f1640f7e8a31c42577b107efa Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Sun, 25 Dec 2022 11:24:07 +0100 Subject: [PATCH 4/4] Remove unused variable --- rc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rc.c b/rc.c index d335564..194e0aa 100644 --- a/rc.c +++ b/rc.c @@ -1245,7 +1245,6 @@ static int do_recursive_mkdir(const char *dir) { char *ch, *dircpy, tmp; - size_t n; struct stat st; if (*dir == '\0')