curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Above and beyond 32 protocols

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Wed, 29 Sep 2021 00:35:57 +0200 (CEST)

On Tue, 28 Sep 2021, Ray Satiro via curl-library wrote:

> and in CURLOPT_PROTOCOLS setopt:
>
> long allowed_protocols = va_arg(param, long);
>
> if((allowed_protocols&CURLPROTO_EXTENDED_FLAG) && allowed_protocols !=
> CURLPROTO_ALL)
>   /* problem */

Since we would also get the problem if we set CURLPROTO_FOO *only*, the check
would probably have to be:

#if SIZEOF_LONG < SIZEOF_CURL_OFF_T
  if(allowed_protocols&CURLPROTO_EXTENDED_FLAG)
    return ERROR;
#endif

... but, this also then assumes that it will actually read the *correct* 4
bytes from the 8 that were pushed on the stack and I don't think it is
guaranteed in the C language so there's a risk that the check won't work.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-09-29