Commit Graph

4473 Commits

Author SHA1 Message Date
d98df66212 * src/url.c (maybe_prepend_scheme): Print message only in verbose mode 2024-11-15 22:28:41 +01:00
ea4009026b maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2024-11-10 22:31:47 +01:00
abb9891387 version 1.25.0
* NEWS: Record release date.
v1.25.0
2024-11-10 22:29:04 +01:00
93748f4c63 * NEWS: Update for release 1.25.0 2024-11-10 22:26:57 +01:00
c419542d95 Fix CVE-2024-10524 (drop support for shorthand URLs)
* doc/wget.texi: Add documentation for removed support for shorthand URLs.
* src/html-url.c (src/html-url.c): Call maybe_prepend_scheme.
* src/main.c (main): Likewise.
* src/retr.c (getproxy): Likewise.
* src/url.c: Rename definition of rewrite_shorthand_url to maybe_prepend_scheme,
  add new function is_valid_port.
* src/url.h: Rename declaration of rewrite_shorthand_url to maybe_prepend_scheme.

Reported-by: Goni Golan <gonig@jfrog.com>
2024-11-10 22:26:57 +01:00
a78b0d4da4 * contrib/make-release: Fix missing variables 2024-11-10 22:26:57 +01:00
c284e9162a * doc/wget.texi: Document the new non-blocking read feature 2024-11-10 19:54:57 +01:00
75840173bb Revert "* configure.ac: Remove searching for makeinfo (breaks doc/ build)"
This reverts commit 04053a7c1e.
2024-11-10 19:54:57 +01:00
5f8d570312 Fix a static analysis false positive
Clang's static analyzer believes that it is possible for a realloc
request to return NULL. However, the `xrealloc` implementation used
in Wget will trigger a program crash if enough memory couldn't be
found. I'm not sure why the analyzer isn't able to see that. But let's
pacify it by asserting here that xrealloc will always return a non-null

 * src/wget.h (DO_REALLOC): Assert that xrealloc will always return
   non-null
2024-11-10 18:30:58 +01:00
742ed3f65c Fix returning uninitialized variable
* src/retr.c (retrieve_from_file): Remove a dead store to status
  (retrieve_from_url_list): Initialize status to a default of RETROK
2024-11-10 18:30:58 +01:00
c4cb544c5d * fuzz/wget_options_fuzzer.c: Work around issue "multiple definition of getaddrinfo" 2024-11-10 18:00:08 +01:00
574632cca7 Fix build error on MingW
Gnulib does not currently implement the `F_GETFL` and `F_SETFL` flags on
mingw. As a result building Wget failed on Windows. We don't currently
have a good solution to this problem and Windows users of Wget will not
get the new functionality of non-blocking file I/O reads. The current
solution is simply to provide a Windows specific no-op stub

 * src/mswindows.c (set_fd_nonblocking): Provide an empty stub function
   for Windows systems
 * src/mswindows.h (set_fd_nonblocking): Export the function so it is
   available in util.c where it is needed
 * src/util.c (set_fd_nonblocking): New function to set a fd as
   O_NONBLOCK on non-Windows, non-MSDOS systems
   (wget_read_from_file): Split the O_NONBLOCK code into
   set_fd_nonblocking and make all file I/O non-blocking, not just stdin
2024-11-10 15:44:29 +01:00
1bc591564d init: fix -Warray-bounds in setval_internal_tilde
>= GCC 12 reports an instance of -Warray-bounds in setval_internal_tilde
with the default -DNDEBUG:
```
In function ‘setval_internal_tilde’,
    inlined from ‘run_wgetrc’ at init.c:710:16:
init.c:940:17: error: array subscript [0, 167] is outside array bounds of ‘const struct <anonymous>[168]’ [-Werror=array-bounds=]
  940 |   if (((commands[comind].action == cmd_file) ||
      |         ~~~~~~~~^~~~~~~~
init.c: In function ‘run_wgetrc’:
init.c:135:3: note: while referencing ‘commands’
  135 | } commands[] = {
      |   ^~~~~~~~
```

setval_internal_tilde calls setval_internal and stores the result in ret;
setval_internal *does* check for if comind is out-of-bounds, but we only
check that *after* dereferencing commands[comind]. Swap the order in the
if() to fix that so we only dereference if we know it's safe.

ChangeLog:

	* src/init.c (setval_internal_tilde): Check 'ret' earlier.

Copyright-paperwork-exempt: Yes
2024-11-10 15:36:43 +01:00
1f7e094899 src/utils.h: Include wget.h before stdlib.h
* src/utils.h: wget.h includes config.h which should be included before
    any other header files. So swap the order of includes
2024-11-10 14:57:15 +01:00
6ff5f2d2b6 * README: Replace FSF address with URL 2024-11-10 12:18:21 +01:00
04053a7c1e * configure.ac: Remove searching for makeinfo (breaks doc/ build) 2024-11-10 11:51:42 +01:00
44472c59b8 * bootstrap: Update from gnulib 2024-11-10 11:30:53 +01:00
27c8c96350 * gnulib: Update 2024-11-10 11:30:34 +01:00
00048762c3 * src/http.c (http_loop): Remove unused code 2024-11-10 11:23:43 +01:00
9bf173e6ae * configure.ac: Drop -Wc99-c11-compat and -Wuseless-cast for manywarnings 2024-11-10 11:23:21 +01:00
6aa6d01742 * Makefile.am: Fix check-coverage from tarball 2024-11-01 19:45:05 +01:00
e70dd2b054 * Makefile.am: Fix creating coverage reports 2024-11-01 18:05:20 +01:00
219c34fea9 * .gitlab-ci.yml: Remove tags to fix CI 2024-11-01 10:48:41 +01:00
2800eb2bed * src/utils.c (compile_posix_regex): Remove redundant casts 2024-10-31 09:52:24 +01:00
054d79cf65 * src/utils.h (strlcpy): Use restrict keywords 2024-10-27 22:17:04 +01:00
80cd939501 * src/hash.c: Include config.h in STANDALONE mode 2024-10-27 18:58:40 +01:00
8775506f63 * src/http.c (http_loop): Fix memory leak 2024-06-09 20:00:45 +02:00
567e67afd2 * src/retr.c (retrieve_from_url_list): Fix memory leak 2024-06-09 19:35:30 +02:00
afa979b43f * src/retr.c (retrieve_from_file): Fix memleak 2024-06-02 14:26:01 +02:00
cd643458b4 * src/warc.c (warc_close): Fix memleak 2024-06-02 14:22:17 +02:00
b88ad88253 * src/warc.c (warc_start_new_file): Simplify code 2024-06-02 14:22:12 +02:00
62fffab577 * src/httpc.c (http_loop): Fix memleak 2024-06-02 14:22:03 +02:00
ecb59f2e02 * src/init.c (cleanup): Do not close stdout on exit 2024-06-02 14:21:58 +02:00
42c83d8972 * src/iri.c (do_conversion): Initialize memory from realloc() 2024-06-02 14:20:06 +02:00
bb0aa299e9 * src/warc.c (warc_write_end_record): Check warc_write_ok (fix use-after-free)" 2024-06-02 14:20:00 +02:00
0490e301d4 * src/wget.h (DO_REALLOC): Initialize realloc'ed memory to help valgrind 2024-06-02 14:19:53 +02:00
a582633c97 * src/utils.c (run_with_timeout): Set SIGALRM handler before setjmp() (reported by valgrind) 2024-06-02 14:19:50 +02:00
5fe01167d1 * fuzz/wget_options_fuzzer.c: Fix indentation 2024-06-02 14:19:42 +02:00
ed0c7c7e0e Properly re-implement userinfo parsing (rfc2396)
* src/url.c (url_skip_credentials): Properly re-implement userinfo parsing (rfc2396)

The reason why the implementation is based on RFC 2396, an outdated standard,
is that the whole file is based on that RFC, and mixing standard here might be
dangerous.
2024-06-02 12:40:21 +02:00
bb59ef7fd4 * fuzz/Makefile.am (oss-fuzz): Add -lgmp 2024-05-24 19:20:32 +02:00
196ce0abd6 Support continious reading from stdin pipes
Rather than reading from stdin only once, leave the pipe open until the
other end closes it and keep reading from the file after each set of
URLs is read

* src/html-url.h(get_urls_file): Update prototype to add additional
  param
* src/html-url.c(get_urls_file): Pass through read_again to
  wget_read_from_file.
* src/retr.c(retrieve_from_file): Split the function into two. Introduce
  `retrieve_from_url_list` that actually performs the retrieval.
  Also, if `url_list` returns that the fd has been left open, then
  continue reading from it until the fd is closed.
  (retrieve_from_url_list): New function that does the retrieval from
  a list of URLs that was read from a file.
* src/utils.c(wget_read_from_file): Rename old function `wget_read_file`
  to this.
  Accept an additional output parameter that states whether the fd was
  left open and if we should continue reading from it after the current
  set of URLs have been processed
  (wget_read_file): Write it as a new wrapper function around
  `wget_read_from_file` to maintain API comptability across other users
2024-05-12 17:57:30 +02:00
ca10f20aaf * gnulib: Update 2024-04-27 19:25:00 +02:00
f6291c33cd Update gnulib link libraries
* fuzz/Makefile.am: Update gnulib link libraries.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
2024-04-20 16:19:51 +00:00
5f0aa59239 Fix libproxy build with --disable-debug
The definition of debug_logprintf in src/log.c is guarded by ENABLE_DEBUG
(although its prototype is unconditionally available in src/log.h).

The uses of debug_logprintf in src/retr.c aren't guarded by ENABLE_DEBUG.

Use the DEBUGP macro which is designed for this purpose.

* src/retr.c (getproxy): Use DEBUGP macro.

Fixes: https://gitlab.com/gnuwget/wget/-/issues/19
Copyright-paperwork-exempt: Yes
2024-04-16 02:23:56 +00:00
1c934e67de Add a new testcase for pathconf truncation
* testenv/Test-recursive-pathmax.py: Add a new testcase. This test tries
  to check that Wget allows downloading long filenames as far as allowed
  by the OS and filesystem.
2024-03-16 19:14:57 +01:00
903373a83c * contrib/make-release: Automatically build and update online documentation 2024-03-11 23:46:36 +01:00
480e9d6efd * contrib/make-release: More minor fixes 2024-03-10 15:21:08 +01:00
637e58ad50 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2024-03-10 15:10:58 +01:00
dad28423c6 version 1.24.5
* NEWS: Record release date.
v1.24.5
2024-03-10 15:08:04 +01:00
fdb4ae8ffe * contrib/make-release: Some more release management 2024-03-10 15:05:53 +01:00