[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 40/264: multi: Improve parameter check for curl_multi_remove_han
From: |
gnunet |
Subject: |
[gnurl] 40/264: multi: Improve parameter check for curl_multi_remove_handle |
Date: |
Thu, 30 Apr 2020 16:05:43 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit a268ad5d7e84189d8dfec3705d84a88ae064f7fc
Author: Jay Satiro <address@hidden>
AuthorDate: Tue Mar 17 18:59:07 2020 -0400
multi: Improve parameter check for curl_multi_remove_handle
- If an easy handle is owned by a multi different from the one specified
then return CURLM_BAD_EASY_HANDLE.
Prior to this change I assume user error could cause corruption.
Closes https://github.com/curl/curl/pull/5116
---
docs/libcurl/libcurl-errors.3 | 4 ++--
lib/multi.c | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/docs/libcurl/libcurl-errors.3 b/docs/libcurl/libcurl-errors.3
index eff6544b6..3ea394e69 100644
--- a/docs/libcurl/libcurl-errors.3
+++ b/docs/libcurl/libcurl-errors.3
@@ -283,8 +283,8 @@ Things are fine.
The passed-in handle is not a valid CURLM handle.
.IP "CURLM_BAD_EASY_HANDLE (2)"
An easy handle was not good/valid. It could mean that it isn't an easy handle
-at all, or possibly that the handle already is in used by this or another
-multi handle.
+at all, or possibly that the handle already is in use by this or another multi
+handle.
.IP "CURLM_OUT_OF_MEMORY (3)"
You are doomed.
.IP "CURLM_INTERNAL_ERROR (4)"
diff --git a/lib/multi.c b/lib/multi.c
index e10e75293..d4f031873 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -700,6 +700,10 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi
*multi,
if(!data->multi)
return CURLM_OK; /* it is already removed so let's say it is fine! */
+ /* Prevent users from trying to remove an easy handle from the wrong multi */
+ if(data->multi != multi)
+ return CURLM_BAD_EASY_HANDLE;
+
if(multi->in_callback)
return CURLM_RECURSIVE_API_CALL;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 146/264: tests: verify split initial HTTP requests with CURL_SMALLREQSEND, (continued)
- [gnurl] 146/264: tests: verify split initial HTTP requests with CURL_SMALLREQSEND, gnunet, 2020/04/30
- [gnurl] 212/264: test1245: make it work with dynamic FTP server port, gnunet, 2020/04/30
- [gnurl] 245/264: test1154: set a proper name, gnunet, 2020/04/30
- [gnurl] 147/264: schannel: support .P12 or .PFX client certificates, gnunet, 2020/04/30
- [gnurl] 163/264: tests: fix conflict between Cygwin/msys and Windows PIDs, gnunet, 2020/04/30
- [gnurl] 155/264: appveyor: ignore failing 'connect to non-listening proxy' tests, gnunet, 2020/04/30
- [gnurl] 160/264: Revert "file: on Windows, refuse paths that start with \\", gnunet, 2020/04/30
- [gnurl] 192/264: test2043: use revoked.badssl.com instead of revoked.grc.com, gnunet, 2020/04/30
- [gnurl] 170/264: tests/server: add hidden window to gracefully handle WM_CLOSE, gnunet, 2020/04/30
- [gnurl] 22/264: TODO: TLS-PSK with OpenSSL, gnunet, 2020/04/30
- [gnurl] 40/264: multi: Improve parameter check for curl_multi_remove_handle,
gnunet <=
- [gnurl] 56/264: test2100: fix static port instead of dynamic value being used, gnunet, 2020/04/30
- [gnurl] 68/264: cirrus: move the sanitizer build from freebsd 13 to freebsd 12, gnunet, 2020/04/30
- [gnurl] 72/264: nghttp2: 1.12.0 required, gnunet, 2020/04/30
- [gnurl] 89/264: TODO: Set custom client ip when using haproxy protocol, gnunet, 2020/04/30
- [gnurl] 91/264: KNOWN_BUGS: "FTPS needs session reuse", gnunet, 2020/04/30
- [gnurl] 178/264: version: increase buffer space for ssl version output, gnunet, 2020/04/30
- [gnurl] 228/264: lib: fix typos in comments and errormessages, gnunet, 2020/04/30
- [gnurl] 37/264: test 970: verify --write-out '%{json}', gnunet, 2020/04/30
- [gnurl] 67/264: Revert "cirrus-ci: disable the FreeBSD 13 builds", gnunet, 2020/04/30
- [gnurl] 95/264: test1177: verify that all the CURL_VERSION_ bits are documented, gnunet, 2020/04/30