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: curl_url_dup does not copy IPv6 zone ID

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 31 Jul 2023 09:56:20 +0200 (CEST)

On Mon, 31 Jul 2023, Rutger Broekhoff via curl-library wrote:

> I wouldn't expect that this would be intended behavior (the curl_url_dup man
> page specifies that all the contents of the CURLU handle are copied, and
> does not note any exceptions). Could anyone confirm that this is indeed
> (not) intended behaviour?

I can confirm that this is a bug.

Here's a first patch. I will write up a PR and add a test case:

diff --git a/lib/urlapi.c b/lib/urlapi.c
index e0c547605..46635ad01 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
_at__at_ -1382,10 +1382,11 _at__at_ CURLU *curl_url_dup(const CURLU *in)
      DUP(u, in, host);
      DUP(u, in, port);
      DUP(u, in, path);
      DUP(u, in, query);
      DUP(u, in, fragment);
+ DUP(u, in, zoneid);
      u->portnum = in->portnum;
    }
    return u;
  fail:
    curl_url_cleanup(u);

-- 
  / 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/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-07-31