[pulseaudio-discuss] [PATCH] card-restore: Handle reading NULL profile name from the database.

Tanu Kaskinen tanuk at iki.fi
Sat Jun 30 03:00:25 PDT 2012


It's assumed in a couple of places that entry_read()
initializes entry->profile to a non-NULL string. This patch
makes those assumptions hold.
---
 src/modules/module-card-restore.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 1079a72..8f9434a 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -199,6 +199,9 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
         goto fail;
     }
 
+    if (!profile)
+        profile = "";
+
     e->profile = pa_xstrdup(profile);
 
     if (!pa_tagstruct_eof(t))
-- 
1.7.10



More information about the pulseaudio-discuss mailing list