mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-04 21:18:03 +02:00
config: ensure that both ABI and MODULE are specified before the properties
If we have properties, strtok will return strings from there as tokens and the error will appear later as we will attempt to parse an incomplete GVariant. It is better to catch this early so that we can print a more useful error message.
This commit is contained in:
parent
22699a4b21
commit
1e7bcd8943
1 changed files with 3 additions and 1 deletions
|
|
@ -152,7 +152,9 @@ parse_commands_file (struct WpDaemonData *d, GInputStream * stream,
|
|||
abi = strtok_r (NULL, " ", &saveptr);
|
||||
module = strtok_r (NULL, " ", &saveptr);
|
||||
|
||||
if (!abi || !module) {
|
||||
if (!abi || !module ||
|
||||
(abi && abi[0] == '{') || (module && module[0] == '{'))
|
||||
{
|
||||
g_set_error (error, WP_DOMAIN_DAEMON, WP_CODE_INVALID_ARGUMENT,
|
||||
"expected ABI and MODULE at line %i", lineno);
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue