From 2ddfa5b265f4285f45424caaa615aa6c12ca67aa Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 27 Dec 2018 16:12:00 +0100 Subject: [PATCH] platform: fix nm_platform_wireguard_peer_to_string() Fixes: 62d14e188489fab4ea8b20527925b47dc2c15f40 --- src/platform/nm-platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index d54670d6a1..af5548ecdc 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -5546,6 +5546,7 @@ nm_platform_lnk_vxlan_to_string (const NMPlatformLnkVxlan *lnk, char *buf, gsize const char * nm_platform_wireguard_peer_to_string (const NMPWireGuardPeer *peer, char *buf, gsize len) { + char *buf0 = buf; gs_free char *public_key_b64 = NULL; char s_endpoint[NM_UTILS_INET_ADDRSTRLEN + 100]; char s_addr[NM_UTILS_INET_ADDRSTRLEN]; @@ -5595,7 +5596,7 @@ nm_platform_wireguard_peer_to_string (const NMPWireGuardPeer *peer, char *buf, g allowed_ip->mask); } - return buf; + return buf0; } const char *