From eac120c5033b9422c4e16ef50ca5afcec9e9d051 Mon Sep 17 00:00:00 2001
From: Maarten Bosmans <mkbosmans@gmail.com>
Date: Mon, 30 Mar 2009 16:24:18 +0200
Subject: [PATCH] handle failure to parse proplist in cli-command gracefully
---
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 4017cb6..3ea1dca 100644
|
a
|
b
|
|
| 699 | 699 | return -1; |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | | p = pa_proplist_from_string(s); |
| | 702 | if (!(p = pa_proplist_from_string(s))) { |
| | 703 | pa_strbuf_puts(buf, "Failed to parse proplist.\n"); |
| | 704 | return -1; |
| | 705 | } |
| 703 | 706 | |
| 704 | 707 | pa_sink_update_proplist(sink, PA_UPDATE_REPLACE, p); |
| 705 | 708 | |
| … |
… |
|
| 733 | 736 | return -1; |
| 734 | 737 | } |
| 735 | 738 | |
| 736 | | p = pa_proplist_from_string(s); |
| | 739 | if (!(p = pa_proplist_from_string(s))) { |
| | 740 | pa_strbuf_puts(buf, "Failed to parse proplist.\n"); |
| | 741 | return -1; |
| | 742 | } |
| 737 | 743 | |
| 738 | 744 | pa_source_update_proplist(source, PA_UPDATE_REPLACE, p); |
| 739 | 745 | |
| … |
… |
|
| 773 | 779 | return -1; |
| 774 | 780 | } |
| 775 | 781 | |
| 776 | | p = pa_proplist_from_string(s); |
| | 782 | if (!(p = pa_proplist_from_string(s))) { |
| | 783 | pa_strbuf_puts(buf, "Failed to parse proplist.\n"); |
| | 784 | return -1; |
| | 785 | } |
| 777 | 786 | |
| 778 | 787 | pa_sink_input_update_proplist(si, PA_UPDATE_REPLACE, p); |
| 779 | 788 | |
| … |
… |
|
| 813 | 822 | return -1; |
| 814 | 823 | } |
| 815 | 824 | |
| 816 | | p = pa_proplist_from_string(s); |
| | 825 | if (!(p = pa_proplist_from_string(s))) { |
| | 826 | pa_strbuf_puts(buf, "Failed to parse proplist.\n"); |
| | 827 | return -1; |
| | 828 | } |
| 817 | 829 | |
| 818 | 830 | pa_source_output_update_proplist(so, PA_UPDATE_REPLACE, p); |
| 819 | 831 | |