You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int max_fd;
mres = curl_multi_fdset(m_multi, nullptr, nullptr, nullptr, &max_fd);
The context here is that I am attempting to emulate curl_multi_poll on libcurl older than 7.66.0.
The idea I had is:
check if libcurl has any fds it waits for
if yes, just call curl_multi_wait
if no, sleep for the wanted timeout
This actually means reporting this bug is pointless since the fallback code I am writing can never make use of a fix. Maybe you still want to update the docs 🤷
If the read_fd_set argument is not a null pointer, it points to an object of type fd_set that on returns specifies the file descriptors to be checked for being ready to read. If the write_fd_set argument is not a null pointer, it points to an object of type fd_set that on return specifies the file descriptors to be checked for being ready to write. If the exc_fd_set argument is not a null pointer, it points to an object of type fd_set that on return specifies the file descriptors to be checked for error conditions pending.
Checking the code reveals no attempt is made to check the sets against null:
... since this funtion has not supported null pointer fd_set arguments since
at least 2006. (That's when I stopped my git blame journey)
Fixes#12691
Reported-by: sfan5 on github
I did this
The context here is that I am attempting to emulate
curl_multi_poll
on libcurl older than 7.66.0.The idea I had is:
curl_multi_wait
This actually means reporting this bug is pointless since the fallback code I am writing can never make use of a fix. Maybe you still want to update the docs 🤷
I expected the following
No crash.
The documentation for curl_multi_fdset says (emphasis mine):
Checking the code reveals no attempt is made to check the sets against null:
curl/lib/multi.c
Lines 1178 to 1189 in d7b6ce6
As far as I know
FD_SET(..., NULL)
is not specified to be safe either.curl/libcurl version
curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.2.0 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.11.0 nghttp2/1.58.0
operating system
Arch Linux x86_64
The text was updated successfully, but these errors were encountered: