diff options
author | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2013-07-02 17:46:11 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2013-07-02 17:49:17 +0300 |
commit | 944ffb0323cdc8cf4483784b37137437ce79986a (patch) | |
tree | a1e270ec2fd4ac8f4442e95d96f098e16b8a046b | |
parent | 242b8e5fd3a00f984f0506de50825dbf3fbb401d (diff) |
device-manager: Refuse to load empty descriptions
-rw-r--r-- | src/modules/module-device-manager.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c index 8f1d9cd75..f57850226 100644 --- a/src/modules/module-device-manager.c +++ b/src/modules/module-device-manager.c @@ -263,6 +263,11 @@ static struct entry* legacy_entry_read(struct userdata *u, pa_datum *data) { return NULL; } + if (!le->description[0]) { + pa_log_warn("Description is empty."); + return NULL; + } + if (!memchr(le->icon, 0, sizeof(le->icon))) { pa_log_warn("Icon has missing NUL byte."); return NULL; @@ -309,6 +314,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 empty."); + goto fail; + } + e->description = pa_xstrdup(description); e->icon = pa_xstrdup(icon); |