1
0
Fork 0
mirror of https://github.com/aria2/aria2.git synced 2025-04-06 05:57:36 +03:00
Commit graph

5383 commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa
7a490fe497 ci: Check build without bittorrent 2023-11-03 11:45:41 +09:00
Tatsuhiro Tsujikawa
94725a0371 Fix build error without bittorrent
Amends 
2023-11-03 11:45:41 +09:00
Tatsuhiro Tsujikawa
d066c72a0d
Merge pull request from aria2/cap-infohashlen
Cap infoHashLength in .aria2 file
2023-11-02 22:20:58 +09:00
Tatsuhiro Tsujikawa
3330110caf Cap infoHashLength in .aria2 file
Cap infoHashLength in .aria2 file, and save an extra allocation.
2023-11-02 21:22:37 +09:00
Tatsuhiro Tsujikawa
d607327ea6 clang-format 2023-11-02 19:27:35 +09:00
Tatsuhiro Tsujikawa
df27e60385
Merge pull request from aria2/cpp-ext
Do not require strict C++ mode and update ax_cxx_compile_stdcxx.m4
2023-11-02 19:13:47 +09:00
Tatsuhiro Tsujikawa
1acfd13c35 Do not require strict C++ mode and update ax_cxx_compile_stdcxx.m4 2023-11-02 18:43:23 +09:00
Tatsuhiro Tsujikawa
35a1b0ff1d
Merge pull request from aria2/bump-compiler
ci: Bump gcc and clang
2023-11-02 18:41:03 +09:00
Tatsuhiro Tsujikawa
be6d819488 ci: Bump gcc and clang 2023-11-02 17:24:22 +09:00
Tatsuhiro Tsujikawa
076dea3896
Merge pull request from egorenar/fix-formatr-string-overflow-in-logger-writeheader
Logger: Fix format string overflow in writeHeader()
2023-10-09 17:28:41 +09:00
Alexander Egorenkov
8718757e6c Logger: Fix format string overflow in writeHeader()
This problem occurred on a 32-bit ARM OpenWRT router running Linux 6.1.
The method writeHeader() assumes that the size of struct timeval is 8 bytes
which is not true on this machine, it is 16 bytes large. Therefore, first
cast tv.tv_usec to the unsigned long type.

=========
GDB trace
=========

 (gdb) c
 Continuing.

 Program received signal SIGSEGV, Segmentation fault.
 0xb6f4f9b4 in memchr (src=src@entry=0x3b6a, c=c@entry=0x0, n=n@entry=0x7fffffff) at src/string/memchr.c:16
 16              for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--);
    0xb6f4f98c <memchr+12>:      00 00 52 e3     cmp     r2, 
    0xb6f4f990 <memchr+16>:      00 30 a0 e1     mov     r3, r0
    0xb6f4f994 <memchr+20>:      05 00 00 1a     bne     0xb6f4f9b0 <memchr+48>
    0xb6f4f998 <memchr+24>:      32 00 00 ea     b       0xb6f4fa68 <memchr+232>
    0xb6f4f99c <memchr+28>:      03 00 13 e3     tst     r3, 
    0xb6f4f9a0 <memchr+32>:      01 20 42 e2     sub     r2, r2, 
    0xb6f4f9a4 <memchr+36>:      36 00 00 0a     beq     0xb6f4fa84 <memchr+260>
    0xb6f4f9a8 <memchr+40>:      00 00 52 e3     cmp     r2, 
    0xb6f4f9ac <memchr+44>:      2d 00 00 0a     beq     0xb6f4fa68 <memchr+232>
    0xb6f4f9b0 <memchr+48>:      03 00 a0 e1     mov     r0, r3
 => 0xb6f4f9b4 <memchr+52>:      01 c0 d3 e4     ldrb    r12, [r3], 
    0xb6f4f9b8 <memchr+56>:      01 00 5c e1     cmp     r12, r1
    0xb6f4f9bc <memchr+60>:      f6 ff ff 1a     bne     0xb6f4f99c <memchr+28>
 (gdb) bt
   0xb6f4f9b4 in memchr (src=src@entry=0x3b6a, c=c@entry=0x0, n=n@entry=0x7fffffff) at src/string/memchr.c:16
   0xb6f512b4 in strnlen (s=s@entry=0x3b6a <error: Cannot access memory at address 0x3b6a>, n=n@entry=0x7fffffff) at src/string/strnlen.c:5
   0xb6f19eb4 in printf_core (f=f@entry=0xb67d35b0, fmt=fmt@entry=0x101856 "%s.%06ld [%s] [%s:%d] ", ap=ap@entry=0xbe8f5a1c, nl_arg=nl_arg@entry=0xbe8f5a48, nl_type=<optimized out>, nl_type@entry=0xbe8f5a20) at
 src/stdio/vfprintf.c:599
   0xb6f4b86c in vfprintf (f=0xb67d35b0, fmt=0x101856 "%s.%06ld [%s] [%s:%d] ", ap=...) at src/stdio/vfprintf.c:688
   0x0001d92c in aria2::OutputFile::printf (this=<optimized out>, format=0x101856 "%s.%06ld [%s] [%s:%d] ") at OutputFile.h:58
   0x00027910 in aria2::(anonymous namespace)::writeHeader<aria2::OutputFile> (lineNum=0xba, sourceFile=0x10d842 "HttpServer.cc", level=aria2::Logger::A2_INFO, fp=...) at Logger.cc:136
   aria2::Logger::writeLog (this=0xb67cf78c, level=aria2::Logger::A2_INFO, sourceFile=0x10d842 "HttpServer.cc", lineNum=0xba, msg=0xb6766280 "HTTP Server received request\nPOST /jsonrpc HTTP/1.1\r\nHost: 192.168
 .1.1:6800\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0\r\nAccept: application/json, text/plain, *"..., msg@entry=0x10d842 "HttpServer.cc", trace=trace@entry=0x124806 "") a
 t Logger.cc:196
   0x00028bf0 in aria2::Logger::log (this=<optimized out>, level=<optimized out>, sourceFile=<optimized out>, lineNum=<optimized out>, msg=0xb6766280 "HTTP Server received request\nPOST /jsonrpc HTTP/1.1\r\nHost
 : 192.168.1.1:6800\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0\r\nAccept: application/json, text/plain, *"...) at Logger.cc:213
   0x00081708 in aria2::HttpServer::receiveRequest (this=0xb6774430) at /home/egorenar/Repositories/openwrt-rel/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/
 include/c++/12.3.0/bits/basic_string.h:233
   aria2::HttpServerCommand::execute (this=0xb6772620) at HttpServerCommand.cc:194
  0x00076de4 in aria2::(anonymous namespace)::executeCommand (commands=..., statusFilter=aria2::Command::STATUS_ALL) at DownloadEngine.cc:139
  0x0001913c in aria2::DownloadEngine::run (oneshot=0x0, this=0xb67967e0) at DownloadEngine.cc:180
  aria2::MultiUrlRequestInfo::execute (this=0xb67dee6c) at MultiUrlRequestInfo.cc:361
  aria2::main (argv=<optimized out>, argc=<optimized out>) at main.cc:78
  main (argc=<optimized out>, argv=<optimized out>) at main.cc:91

 (gdb) p tv
 $13 = {
   tv_sec = 0x652134fd,
   tv_usec = 0x3b6a
 }
 (gdb) call sizeof(tv)
 $14 = 0x10
 (gdb) call sizeof(tv.tv_usec)
 $15 = 0x8
 (gdb) call sizeof(long)
 $16 = 0x4
 (gdb) call sizeof(unsigned long)
 $17 = 0x4
 (gdb) call sizeof(time_t)
 $18 = 0x8

Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
2023-10-07 14:29:01 +02:00
Tatsuhiro Tsujikawa
80d53a9e80
Merge pull request from aria2/memcpy
Avoid non-nil argument errors
2023-09-18 18:35:14 +09:00
Tatsuhiro Tsujikawa
d53735bf49
Merge pull request from aria2/dont-close-stderr-stdout
Do not close stdout and stderr
2023-09-18 18:17:19 +09:00
Tatsuhiro Tsujikawa
4fdcd22d69 Avoid non-nil argument errors
Use std::copy_n and std::fill_n to avoid a non-nil argument error with
memcpy/memset.
2023-09-18 17:29:48 +09:00
Tatsuhiro Tsujikawa
5047e4a4ab Do not close stdout and stderr 2023-09-18 17:28:47 +09:00
Tatsuhiro Tsujikawa
f05deb0cb2
Merge pull request from aria2/static-check-fix
Static check fix
2023-09-18 11:29:23 +09:00
Tatsuhiro Tsujikawa
4c250f8a5d Bail out if pieceLength is 0 2023-09-18 11:00:00 +09:00
Tatsuhiro Tsujikawa
1fd0e52c41 Call the member function of IOFile 2023-09-18 10:55:26 +09:00
Tatsuhiro Tsujikawa
c2109a5aca Move instead of copy 2023-09-18 10:22:22 +09:00
Tatsuhiro Tsujikawa
f0015d2175
Merge pull request from aria2/update-sphinx_rtd_theme
Update sphinx_rtd_theme
2023-09-18 01:10:22 +09:00
Tatsuhiro Tsujikawa
dfc607ae74
Merge pull request from aria2/docker-mingw-update-cp
Dockerfile.mingw: Update how to get aria2c.exe from a container
2023-09-18 01:09:57 +09:00
Tatsuhiro Tsujikawa
b18d47c60b
Merge pull request from aria2/docker-mingw-update-libssh2-flags
Dockerfile.mingw: Remove deprecated libssh2 configure flags
2023-09-18 01:09:30 +09:00
Tatsuhiro Tsujikawa
274e5048cb Update sphinx_rtd_theme 2023-09-17 21:32:27 +09:00
Tatsuhiro Tsujikawa
376a07df00 Dockerfile.mingw: Update how to get aria2c.exe from a container 2023-09-17 21:28:42 +09:00
Tatsuhiro Tsujikawa
e2209a8ae1
Merge pull request from aria2/docker-android-add-dpkg-dev
Dockerfile.android: Add dpkg-dev for dpkg-architecture
2023-09-17 21:26:28 +09:00
Tatsuhiro Tsujikawa
4352a31e6b Dockerfile.mingw: Remove deprecated libssh2 configure flags 2023-09-17 21:25:11 +09:00
Tatsuhiro Tsujikawa
506aac6b4e
Merge pull request from aria2/docker-mingw-parallel-build
Dockerfile.mingw: Parallel build
2023-09-17 21:24:24 +09:00
Tatsuhiro Tsujikawa
6b50ff403c Dockerfile.android: Add dpkg-dev for dpkg-architecture 2023-09-17 20:49:31 +09:00
Tatsuhiro Tsujikawa
8907b8355c Dockerfile.mingw: Parallel build 2023-09-17 20:48:19 +09:00
Tatsuhiro Tsujikawa
06e3fdbd48
Merge pull request from aria2/release-with-docker
Make releases with docker
2023-09-17 20:46:56 +09:00
Tatsuhiro Tsujikawa
85142435c6 Make releases with docker
This is slightly different from the current procedure because now
android and mingw binaries are built from source code fetched from the
remote repository.
2023-09-17 19:59:50 +09:00
Tatsuhiro Tsujikawa
80534d869f
Merge pull request from aria2/fix-overflow
Fix overflow
2023-09-16 20:00:42 +09:00
Tatsuhiro Tsujikawa
52469aba85 Fix overflow 2023-09-16 19:17:40 +09:00
Tatsuhiro Tsujikawa
2a809a99cd
Merge pull request from aria2/revert-ci-docker-mingw
Revert "ci: Build mingw image"
2023-09-16 19:14:47 +09:00
Tatsuhiro Tsujikawa
997efc88bb Revert "ci: Build mingw image"
This reverts commit a02ceeb646.
2023-09-16 18:42:23 +09:00
Tatsuhiro Tsujikawa
3a0057257c
Merge pull request from aria2/ci-docker-mingw
ci: Build mingw image
2023-09-16 18:29:27 +09:00
Tatsuhiro Tsujikawa
42b9893463
Merge pull request from aria2/ci-gnutls
ci: Build with gnutls
2023-09-16 18:29:12 +09:00
Tatsuhiro Tsujikawa
a02ceeb646 ci: Build mingw image 2023-09-16 18:06:11 +09:00
Tatsuhiro Tsujikawa
81244a16dd ci: Build with gnutls 2023-09-16 17:45:55 +09:00
Tatsuhiro Tsujikawa
dbbd1bfbf9
Merge pull request from aria2/fix-undefined
Fix test errors with ubsan
2023-09-16 17:45:35 +09:00
Tatsuhiro Tsujikawa
e5d9ad2f0b Fix test errors with ubsan 2023-09-16 17:22:33 +09:00
Tatsuhiro Tsujikawa
dfdbc22b23
Merge pull request from aria2/update-wslay
Update wslay
2023-09-16 17:18:00 +09:00
Tatsuhiro Tsujikawa
66048398e5 Update wslay 2023-09-16 16:53:03 +09:00
Tatsuhiro Tsujikawa
ef28a269ae
Merge pull request from aria2/remove-deprecated-unary-binary-fun
Remove deprecated std::unary_function and std::binary_function
2023-09-16 16:50:14 +09:00
Tatsuhiro Tsujikawa
8956c58d12 Remove deprecated std::unary_function and std::binary_function 2023-09-16 16:24:23 +09:00
Tatsuhiro Tsujikawa
ea6d4240d0
Merge pull request from aria2/dockerfile-android
Add Dockerfile.android
2023-09-16 16:23:58 +09:00
Tatsuhiro Tsujikawa
13ba7a297f Add Dockerfile.android 2023-09-16 15:52:33 +09:00
Tatsuhiro Tsujikawa
e5bc00d449
Merge pull request from FH0/master
android(ndk r23) has timegm
2023-09-16 15:40:34 +09:00
Tatsuhiro Tsujikawa
8ae5ce5df3
Merge pull request from aria2/crypto-lib-rand
Prefer random number generator from crypto libraries
2023-09-16 11:56:50 +09:00
Tatsuhiro Tsujikawa
fa2eb95a00 Prefer random number generator from crypto libraries 2023-09-16 11:37:01 +09:00