From 9464fa0963116d8af9386ee9f571f3fddef8d50f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 15 Nov 2017 18:31:13 +0100 Subject: [PATCH] vpn: avoid coverity warning in print_vpn_config() coverity thinks that @address4 might be NULL. Maybe it can. We have an nm_assert(), but to be sure, check the value. (cherry picked from commit 6df212ccb140eff6e19db4d03f0ea42c568a561a) --- src/vpn/nm-vpn-connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c index 2436ea335a..929061847c 100644 --- a/src/vpn/nm-vpn-connection.c +++ b/src/vpn/nm-vpn-connection.c @@ -1007,8 +1007,8 @@ print_vpn_config (NMVpnConnection *self) if (priv->ip4_internal_gw) _LOGI ("Data: Internal Gateway: %s", nm_utils_inet4_ntop (priv->ip4_internal_gw, NULL)); - _LOGI ("Data: Internal Address: %s", nm_utils_inet4_ntop (address4->address, NULL)); - _LOGI ("Data: Internal Prefix: %d", address4->plen); + _LOGI ("Data: Internal Address: %s", address4 ? nm_utils_inet4_ntop (address4->address, NULL) : "??"); + _LOGI ("Data: Internal Prefix: %d", address4 ? (int) address4->plen : -1); _LOGI ("Data: Internal Point-to-Point Address: %s", nm_utils_inet4_ntop (address4->peer_address, NULL)); nm_ip_config_iter_ip4_route_for_each (&ipconf_iter, priv->ip4_config, &route) {