From: Tanu Kaskinen Date: Tue, 4 Jun 2013 17:42:48 +0000 (+0300) Subject: device-manager: Add a sanity check for reading entries X-Git-Tag: accepted/tizen/20131022.162753~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67132eea1a987a3cecd6f9edefb5f62df7308c97;p=platform%2Fupstream%2Fpulseaudio.git device-manager: Add a sanity check for reading entries There is code elsewhere that assumes that if user_set_description is true, then the description is non-NULL. --- diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c index 47c78d4..8f1d9cd 100644 --- a/src/modules/module-device-manager.c +++ b/src/modules/module-device-manager.c @@ -304,6 +304,11 @@ static struct entry* entry_read(struct userdata *u, const char *name) { goto fail; } + if (e->user_set_description && !description) { + pa_log("Entry has user_set_description set, but the description is NULL."); + goto fail; + } + e->description = pa_xstrdup(description); e->icon = pa_xstrdup(icon);