[pulseaudio-discuss] [PATCH 2/2] raop: Properly deal with the name coming from the device.

Colin Guthrie colin at mageia.org
Tue Sep 6 03:53:55 PDT 2011


We need to properly quote our proplist arguments passed to the module.
---
 src/modules/raop/module-raop-discover.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/modules/raop/module-raop-discover.c b/src/modules/raop/module-raop-discover.c
index 1a7572c..4ebe5fc 100644
--- a/src/modules/raop/module-raop-discover.c
+++ b/src/modules/raop/module-raop-discover.c
@@ -156,7 +156,9 @@ static void resolver_cb(
             ++nicename;
             if (strlen(nicename) > 0) {
                 pa_log_debug("Found RAOP: %s", nicename);
-            }
+                nicename = pa_escape(nicename, "\"'");
+            } else
+                nicename = NULL;
         }
 
         for (l = txt; l; l = l->next) {
@@ -189,11 +191,11 @@ static void resolver_cb(
         if (nicename) {
             args = pa_sprintf_malloc("server=[%s]:%u "
                                      "sink_name=%s "
-                                     "sink_properties=device.description=\"%s\"",
+                                     "sink_properties='device.description=\"%s\"'",
                                      avahi_address_snprint(at, sizeof(at), a), port,
                                      vname,
                                      nicename);
-
+            pa_xfree(nicename);
         } else {
             args = pa_sprintf_malloc("server=[%s]:%u "
                                      "sink_name=%s",
-- 
1.7.6



More information about the pulseaudio-discuss mailing list