summaryrefslogtreecommitdiff
path: root/libdleyna
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:08:08 +0200
committerLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-07-01 15:11:32 +0200
commite56b7dde57b165a6befb1079925ff7eba0134943 (patch)
tree93ee4ad5c5da3be61418a0d4cef1ea5702c3eed8 /libdleyna
parent37cc52275ac661b80d77d98353e2207e419f9276 (diff)
downloaddleyna-server-e56b7dde57b165a6befb1079925ff7eba0134943.tar.gz
[Klockwork] NULL pointer may be dereferenced. (#26)
Fix issue #26: ip_address may be NULL and may be dereferenced. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
Diffstat (limited to 'libdleyna')
-rw-r--r--libdleyna/server/upnp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libdleyna/server/upnp.c b/libdleyna/server/upnp.c
index 92b3943..2185663 100644
--- a/libdleyna/server/upnp.c
+++ b/libdleyna/server/upnp.c
@@ -163,12 +163,13 @@ static void prv_server_available_cb(GUPnPControlPoint *cp,
prv_device_new_ct_t *priv_t;
udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
- if (!udn)
- goto on_error;
ip_address = gupnp_context_get_host_ip(
gupnp_control_point_get_context(cp));
+ if (!udn || !ip_address)
+ goto on_error;
+
DLEYNA_LOG_DEBUG("UDN %s", udn);
DLEYNA_LOG_DEBUG("IP Address %s", ip_address);