Blame SOURCES/0003-dbus-don-t-crash-if-we-can-t-determine-alternative-s.patch

e1f8e0
From c17ad43fc445ee649f1020378d8464b96ce57102 Mon Sep 17 00:00:00 2001
e1f8e0
From: Michal Sekletar <msekleta@redhat.com>
e1f8e0
Date: Mon, 13 Apr 2015 10:06:41 +0200
e1f8e0
Subject: [PATCH 3/4] dbus: don't crash if we can't determine alternative
e1f8e0
 {service,host} name
e1f8e0
e1f8e0
Resolves: #1003688
e1f8e0
---
e1f8e0
 avahi-daemon/dbus-protocol.c | 10 ++++++++++
e1f8e0
 1 file changed, 10 insertions(+)
e1f8e0
e1f8e0
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
e1f8e0
index eb8a662..d7738bd 100644
e1f8e0
--- a/avahi-daemon/dbus-protocol.c
e1f8e0
+++ b/avahi-daemon/dbus-protocol.c
e1f8e0
@@ -391,6 +391,11 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
e1f8e0
         }
e1f8e0
 
e1f8e0
         t = avahi_alternative_host_name(n);
e1f8e0
+        if (!t) {
e1f8e0
+            avahi_log_warn("Failed to determine alternative host name");
e1f8e0
+            goto fail;
e1f8e0
+        }
e1f8e0
+
e1f8e0
         avahi_dbus_respond_string(c, m, t);
e1f8e0
         avahi_free(t);
e1f8e0
 
e1f8e0
@@ -405,6 +410,11 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
e1f8e0
         }
e1f8e0
 
e1f8e0
         t = avahi_alternative_service_name(n);
e1f8e0
+        if (!t) {
e1f8e0
+            avahi_log_warn("Failed to determine alternative service name");
e1f8e0
+            goto fail;
e1f8e0
+        }
e1f8e0
+
e1f8e0
         avahi_dbus_respond_string(c, m, t);
e1f8e0
         avahi_free(t);
e1f8e0
 
e1f8e0
-- 
e1f8e0
2.3.4
e1f8e0