summary refs log tree commit diff
path: root/libnm-core/nm-setting-wireguard.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-08-19 10:13:49 +0200
committerMichael Biebl <biebl@debian.org>2020-08-19 10:13:49 +0200
commite7b44ef4c80907346ec7492a09c45277459924fc (patch)
treeb1388af193ca205f73336eca47e81815e43a61ca /libnm-core/nm-setting-wireguard.c
parent136d191f1c96dbae1489fed7c2565f5e1b1f8d40 (diff)
New upstream version 1.26.2 upstream/1.26.2
Diffstat (limited to 'libnm-core/nm-setting-wireguard.c')
-rw-r--r--libnm-core/nm-setting-wireguard.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libnm-core/nm-setting-wireguard.c b/libnm-core/nm-setting-wireguard.c
index 2bd633ce..3b2815c0 100644
--- a/libnm-core/nm-setting-wireguard.c
+++ b/libnm-core/nm-setting-wireguard.c
@@ -592,13 +592,16 @@ nm_wireguard_peer_get_allowed_ip (const NMWireGuardPeer *self,
 {
 	const char *s;
 
+	/* With LTO, the compiler might warn about the g_return_val_if_fail()
+	 * code path not initializing the output argument. Workaround that by
+	 * always setting the out argument. */
+	NM_SET_OUT (out_is_valid, FALSE);
+
 	g_return_val_if_fail (NM_IS_WIREGUARD_PEER (self, TRUE), NULL);
 
 	if (   !self->allowed_ips
-	    || idx >= self->allowed_ips->len) {
-		NM_SET_OUT (out_is_valid, FALSE);
+	    || idx >= self->allowed_ips->len)
 		return NULL;
-	}
 
 	s = self->allowed_ips->pdata[idx];
 	NM_SET_OUT (out_is_valid, s[0] != ALLOWED_IP_INVALID_X);