mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
device-manager: Refuse to load empty descriptions
This commit is contained in:
parent
242b8e5fd3
commit
944ffb0323
1 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue