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

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