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
This commit is contained in:
Jay Satiro 2019-12-27 23:39:24 -05:00
parent ea6d6205d9
commit b700662b1c
7 changed files with 17 additions and 4 deletions

View file

@ -140,7 +140,8 @@ m6: Unknown option
m7: The easy handle is already added to a multi handle
m8: API function called from within callback
m9: Wakeup is unavailable or failed
m10: Unknown error
m10: A libcurl function was given a bad argument
m11: Unknown error
s0: No error
s1: Unknown share option
s2: Share currently in use