diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2009-03-30 16:24:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-03-31 00:43:48 +0200 |
commit | 4a40aed9c0aa0d07450bb3334a435064466e94df (patch) | |
tree | 01f34f62d34e5ef0f81a8886aaadd83b9f8f2a23 | |
parent | cab1e54392728251bd3b724e42d2b022aa7e7ad2 (diff) |
handle failure to parse proplist in cli-command gracefully
-rw-r--r-- | src/pulsecore/cli-command.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c index 4017cb68..3ea1dca5 100644 --- a/src/pulsecore/cli-command.c +++ b/src/pulsecore/cli-command.c @@ -699,7 +699,10 @@ static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_s return -1; } - p = pa_proplist_from_string(s); + if (!(p = pa_proplist_from_string(s))) { + pa_strbuf_puts(buf, "Failed to parse proplist.\n"); + return -1; + } pa_sink_update_proplist(sink, PA_UPDATE_REPLACE, p); @@ -733,7 +736,10 @@ static int pa_cli_command_update_source_proplist(pa_core *c, pa_tokenizer *t, pa return -1; } - p = pa_proplist_from_string(s); + if (!(p = pa_proplist_from_string(s))) { + pa_strbuf_puts(buf, "Failed to parse proplist.\n"); + return -1; + } pa_source_update_proplist(source, PA_UPDATE_REPLACE, p); @@ -773,7 +779,10 @@ static int pa_cli_command_update_sink_input_proplist(pa_core *c, pa_tokenizer *t return -1; } - p = pa_proplist_from_string(s); + if (!(p = pa_proplist_from_string(s))) { + pa_strbuf_puts(buf, "Failed to parse proplist.\n"); + return -1; + } pa_sink_input_update_proplist(si, PA_UPDATE_REPLACE, p); @@ -813,7 +822,10 @@ static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer return -1; } - p = pa_proplist_from_string(s); + if (!(p = pa_proplist_from_string(s))) { + pa_strbuf_puts(buf, "Failed to parse proplist.\n"); + return -1; + } pa_source_output_update_proplist(so, PA_UPDATE_REPLACE, p); |