device-manager: Refuse to load empty descriptions

This commit is contained in:
Tanu Kaskinen 2013-07-02 17:46:11 +03:00
parent 242b8e5fd3
commit 944ffb0323

View file

@ -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);