fix dav repo-url command containing the password base64 encoded

Tue, 09 Apr 2024 21:43:36 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 09 Apr 2024 21:43:36 +0200
changeset 811
9385330bdd38
parent 810
baf199df500e
child 812
5fe4453fc025

fix dav repo-url command containing the password base64 encoded

dav/main.c file | annotate | diff | comparison | revisions
--- a/dav/main.c	Tue Apr 09 21:28:24 2024 +0200
+++ b/dav/main.c	Tue Apr 09 21:43:36 2024 +0200
@@ -2536,14 +2536,16 @@
             }
             printf("%.*s", (int)repo->user.value.length, repo->user.value.ptr);
             if(repo->password.value.ptr) {
+                cxmutstr pw_decoded = dav_repository_get_decodedpassword(repo);
                 CURL *curl = curl_easy_init();
                 char *pw = curl_easy_escape(
                         curl,
-                        repo->password.value.ptr,
-                        repo->password.value.length);
+                        pw_decoded.ptr,
+                        pw_decoded.length);
                 printf(":%s", pw);
                 curl_free(pw);
                 curl_easy_cleanup(curl);
+                free(pw_decoded.ptr);
             }
             putchar('@');
             printf("%.*s", (int)url.length-hostindex, url.ptr+hostindex);

mercurial