File libproxy-ignore-invalid-uri.patch of Package libproxy.37063

From 3ddd6747f07f1a810d806573511680ab30cc5ded Mon Sep 17 00:00:00 2001
From: Alynx Zhou <alynx.zhou@gmail.com>
Date: Mon, 26 Aug 2024 18:59:04 +0800
Subject: [PATCH] Ignore invalid proxy URL

This prevents further GUri API call on NULL pointer. For example,
`FTP_PROXY=""` will lead into a NULL here.
---
 src/backend/px-manager.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/px-manager.c b/src/backend/px-manager.c
index 8e9af96e..ec770d2e 100644
--- a/src/backend/px-manager.c
+++ b/src/backend/px-manager.c
@@ -669,6 +669,10 @@ px_manager_get_proxies_sync (PxManager  *self,
 
     g_debug ("%s: Config[%d] = %s", __FUNCTION__, idx, config[idx]);
 
+    /* Ignore invalid proxy URL, so we won't call GUri API on NULL. */
+    if (!conf_url)
+      continue;
+
     if (px_manager_expand_wpad (self, conf_url) || px_manager_expand_pac (self, conf_url)) {
       GList *list;
 
openSUSE Build Service is sponsored by