From b700662b1c77c8af7e290538f748b71d75a79ae7 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Fri, 27 Dec 2019 23:39:24 -0500 Subject: multi: Change curl_multi_wait/poll to error on negative timeout - Add new error CURLM_BAD_FUNCTION_ARGUMENT and return that error when curl_multi_wait/poll is passed timeout param < 0. Prior to this change passing a negative value to curl_multi_wait/poll such as -1 could cause the function to wait forever. Reported-by: hamstergene@users.noreply.github.com Fixes https://github.com/curl/curl/issues/4763 Closes https://github.com/curl/curl/pull/4765 --- include/curl/multi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/curl/multi.h b/include/curl/multi.h index 21d8407b5..bda9bb7b8 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -72,7 +72,8 @@ typedef enum { attempted to get added - again */ CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a callback */ - CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */ + CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */ + CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */ CURLM_LAST } CURLMcode; -- cgit v1.2.3