From cec6b153b7803ccc5bab812638a01dce0def312a Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Sat, 30 Jun 2012 13:00:25 +0300 Subject: [PATCH] card-restore: Handle reading NULL profile name from the database. 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. Tested-by: Mikel Astiz --- 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 9a7d732..7d101c5 100644 --- a/src/modules/module-card-restore.c +++ b/src/modules/module-card-restore.c @@ -223,6 +223,9 @@ static struct entry* entry_read(struct userdata *u, const char *name) { goto fail; } + if (!profile) + profile = ""; + e->profile = pa_xstrdup(profile); if (e->version >= 2) { -- 2.7.4