From a7f34521d7ad88be3a1f1251e9bcccd07385584a Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Jul 21 2015 15:35:06 +0000 Subject: Fix a crash on configuration without format --- diff --git a/ezstream-0.6.0-Check-for-undefined-stream-format.patch b/ezstream-0.6.0-Check-for-undefined-stream-format.patch new file mode 100644 index 0000000..021f32e --- /dev/null +++ b/ezstream-0.6.0-Check-for-undefined-stream-format.patch @@ -0,0 +1,41 @@ +From e95150836e332a2522b90382c8a1d4b56ac3ce26 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 21 Jul 2015 16:15:07 +0200 +Subject: [PATCH] Check for undefined stream format +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +format element is mandatory but the server will crash if it does not +exist in the configuration file. This patch handle the case +gracefully. + +It does not raise an error on unsupported value because documentation +allows it. + + + +Signed-off-by: Petr Písař +--- + src/util.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/util.c b/src/util.c +index 9ecd430..20c2acc 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -135,6 +135,11 @@ stream_setup(const char *host, unsigned short port, const char *mount) + return (NULL); + } + ++ if (NULL == pezConfig->format) { ++ printf("%s: stream format is missing\n", __progname); ++ shout_free(shout); ++ return (NULL); ++ } + if (!strcmp(pezConfig->format, MP3_FORMAT) && + shout_set_format(shout, SHOUT_FORMAT_MP3) != SHOUTERR_SUCCESS) { + printf("%s: shout_set_format(MP3): %s\n", +-- +2.4.3 + diff --git a/ezstream.spec b/ezstream.spec index ba5eadd..2702417 100644 --- a/ezstream.spec +++ b/ezstream.spec @@ -1,6 +1,6 @@ Name: ezstream Version: 0.6.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Command line source client for Icecast media streaming servers Group: Applications/Multimedia ## Not installed files: @@ -25,6 +25,9 @@ Group: Applications/Multimedia License: GPLv2 and BSD and MIT URL: http://www.icecast.org/%{name}/ Source0: http://downloads.xiph.org/releases/%{name}/%{name}-%{version}.tar.gz +# Fix a crash on configuration without format, bug #1244481, +# +Patch0: ezstream-0.6.0-Check-for-undefined-stream-format.patch BuildRequires: glibc-headers BuildRequires: pkgconfig(libxml-2.0) >= 2 BuildRequires: pkgconfig(shout) >= 2.2 @@ -46,6 +49,7 @@ more formats understood by TagLib library. %prep %setup -q +%patch0 -p1 mkdir __examples cp -a examples __examples/examples rm -f __examples/examples/Makefile* @@ -71,6 +75,9 @@ rm -rf $RPM_BUILD_ROOT%{_docdir} $RPM_BUILD_ROOT%{_datadir}/examples %{_mandir}/man1/ezstream-file.sh.1.gz %changelog +* Tue Jul 21 2015 Petr Pisar - 0.6.0-3 +- Fix a crash on configuration without format (bug #1244481) + * Wed Jun 17 2015 Fedora Release Engineering - 0.6.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild