diff mbox series

Fix URL validation for more than one URLs.

Message ID mailman.1440.1619955388.1230.openwrt-devel@lists.openwrt.org
State Changes Requested
Delegated to: Baptiste Jonglez
Headers show
Series Fix URL validation for more than one URLs. | expand

Commit Message

Thomas Richard via openwrt-devel May 2, 2021, 11:36 a.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
From: Fabian Baumanis <fabian.baumanis@mailbox.org>

---
 uclient-fetch.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/uclient-fetch.c b/uclient-fetch.c
index 282092e..d046100 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -384,14 +384,23 @@  static void request_done(struct uclient *cl)
 	if (n_urls) {
 		proxy_url = get_proxy_url(*urls);
 		if (proxy_url) {
-			uclient_set_url(cl, proxy_url, NULL);
+			error_ret = uclient_set_url(cl, proxy_url, NULL);
 			uclient_set_proxy_url(cl, *urls, auth_str);
 		} else {
-			uclient_set_url(cl, *urls, auth_str);
+			error_ret = uclient_set_url(cl, *urls, auth_str);
 		}
+
+		if (error_ret < 0) {
+			fprintf(stderr, "Failed to allocate uclient context for %s\n", *urls);
+			uclient_disconnect(cl);
+			uloop_end();
+			return;
+		}
+
 		n_urls--;
 		cur_resume = resume;
 		error_ret = init_request(cl);
+
 		if (error_ret == 0)
 			return;
 	}