[farsight2/master] Check if both fields are not NULL before strcmping them
Olivier Crête
olivier.crete at collabora.co.uk
Tue Mar 31 10:40:34 PDT 2009
---
transmitters/multicast/fs-multicast-transmitter.c | 3 ++-
transmitters/rawudp/fs-rawudp-transmitter.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/transmitters/multicast/fs-multicast-transmitter.c b/transmitters/multicast/fs-multicast-transmitter.c
index 226dde4..cabd884 100644
--- a/transmitters/multicast/fs-multicast-transmitter.c
+++ b/transmitters/multicast/fs-multicast-transmitter.c
@@ -825,7 +825,8 @@ fs_multicast_transmitter_get_udpsock_locked (FsMulticastTransmitter *trans,
if (port == udpsock->port &&
!strcmp (multicast_ip, udpsock->multicast_ip) &&
((local_ip == NULL && udpsock->local_ip == NULL) ||
- !strcmp (local_ip, udpsock->local_ip)))
+ (local_ip && udpsock->local_ip &&
+ !strcmp (local_ip, udpsock->local_ip))))
{
if (ttl > udpsock->current_ttl)
{
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index 47d4a9f..8fd0bc5 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -776,7 +776,8 @@ fs_rawudp_transmitter_get_udpport_locked (FsRawUdpTransmitter *trans,
udpport = udpport_e->data;
if (requested_port == udpport->requested_port &&
((requested_ip == NULL && udpport->requested_ip == NULL) ||
- !strcmp (requested_ip, udpport->requested_ip)))
+ (requested_ip && udpport->requested_ip &&
+ !strcmp (requested_ip, udpport->requested_ip))))
{
GST_LOG ("Got port refcount %d->%d", udpport->refcount,
udpport->refcount+1);
--
1.5.6.5
More information about the farsight-commits
mailing list