mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-04-25 18:00:39 +02:00
m-settings: Fix the crash with empty settings
Add a null check when iterator gets the value to detect the end of the JSON object, this will ensure the rest of the code that operates on the value is bypassed. Still it must be noted that an empty setting screws up the following settings and behavior is undefined, this is the limiation in the spa-json parsing.
This commit is contained in:
parent
8a0c4fde4c
commit
3011a1c07e
2 changed files with 3 additions and 3 deletions
|
|
@ -160,7 +160,8 @@ do_parse_settings (void *data, const char *location,
|
|||
int len = 0;
|
||||
|
||||
g_value_unset (&item);
|
||||
wp_iterator_next (iter, &item);
|
||||
if (!wp_iterator_next (iter, &item))
|
||||
break;
|
||||
j = g_value_get_boxed (&item);
|
||||
|
||||
value = wp_spa_json_parse_string (j);
|
||||
|
|
@ -190,7 +191,7 @@ static int
|
|||
do_parse_endpoints (void *data, const char *location,
|
||||
const char *section, const char *str, size_t len)
|
||||
{
|
||||
do_parse_settings (data, location, section, str, len);
|
||||
return do_parse_settings (data, location, section, str, len);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ wireplumber.components = [
|
|||
|
||||
# Switch bluetooth profile based on media.role
|
||||
{ name = policy-bluetooth.lua , type = script/lua }
|
||||
|
||||
]
|
||||
|
||||
wireplumber.settings = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue