[libreoffice/f18] Resolves: rhbz#891082 catch libcdr exceptions (RHEL6)
Michael Stahl
mstahl at fedoraproject.org
Fri Jan 4 23:46:13 UTC 2013
commit 4988cec64df1dfa5dbb81238c7a6f6abb86bc489
Author: Michael Stahl <mstahl at redhat.com>
Date: Sat Jan 5 00:45:50 2013 +0100
Resolves: rhbz#891082 catch libcdr exceptions (RHEL6)
...-CMXDocument-isSupported-catch-exceptions.patch | 81 ++++++++++++++++++++
libreoffice.spec | 5 +
2 files changed, 86 insertions(+), 0 deletions(-)
---
diff --git a/0001-rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch b/0001-rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch
new file mode 100644
index 0000000..e898217
--- /dev/null
+++ b/0001-rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch
@@ -0,0 +1,81 @@
+From bdec160f1b746a18e4f91553786b914ac1bd889c Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl at redhat.com>
+Date: Fri, 4 Jan 2013 23:44:38 +0100
+Subject: [PATCH] rhbz#891082: CMXDocument::isSupported: catch exceptions
+
+(cherry picked from commit 374f7465729c98f2cc8af72f876a8eab01d192a6)
+
+Conflicts:
+ libcdr/UnpackedTarball_cdr.mk
+
+Change-Id: I715975dfa93d736cb537076feab4afe6b75c162a
+---
+ libcdr/libcdr-issupported-exception.patch.1 | 42 +++++++++++++++++++++++++++++
+ libcdr/makefile.mk | 2 ++
+ 2 files changed, 44 insertions(+)
+ create mode 100644 libcdr/libcdr-issupported-exception.patch.1
+
+diff --git a/libcdr/libcdr-issupported-exception.patch.1 b/libcdr/libcdr-issupported-exception.patch.1
+new file mode 100644
+index 0000000..4196c46
+--- /dev/null
++++ b/libcdr/libcdr-issupported-exception.patch.1
+@@ -0,0 +1,42 @@
++rhbz#891082: CMXDocument::isSupported: catch exceptions
++
++--- misc/libcdr-0.0.9/src/lib/CMXDocument.cpp
+++++ misc/build/libcdr-0.0.9/src/lib/CMXDocument.cpp
++@@ -46,20 +46,24 @@
++ */
++ bool libcdr::CMXDocument::isSupported(WPXInputStream *input)
++ {
++- input->seek(0, WPX_SEEK_SET);
++- unsigned riff = readU32(input);
++- if (riff != FOURCC_RIFF && riff != FOURCC_RIFX)
++- return false;
++- input->seek(4, WPX_SEEK_CUR);
++- char signature_c = (char)readU8(input);
++- if (signature_c != 'C' && signature_c != 'c')
++- return false;
++- char signature_d = (char)readU8(input);
++- if (signature_d != 'M' && signature_d != 'm')
++- return false;
++- char signature_r = (char)readU8(input);
++- if (signature_r != 'X' && signature_r != 'x')
+++ try {
+++ input->seek(0, WPX_SEEK_SET);
+++ unsigned riff = readU32(input);
+++ if (riff != FOURCC_RIFF && riff != FOURCC_RIFX)
+++ return false;
+++ input->seek(4, WPX_SEEK_CUR);
+++ char signature_c = (char)readU8(input);
+++ if (signature_c != 'C' && signature_c != 'c')
+++ return false;
+++ char signature_d = (char)readU8(input);
+++ if (signature_d != 'M' && signature_d != 'm')
+++ return false;
+++ char signature_r = (char)readU8(input);
+++ if (signature_r != 'X' && signature_r != 'x')
+++ return false;
+++ } catch (...) {
++ return false;
+++ }
++ return true;
++ }
++
+diff --git a/libcdr/makefile.mk b/libcdr/makefile.mk
+index 0a8df79..2ede985 100755
+--- a/libcdr/makefile.mk
++++ b/libcdr/makefile.mk
+@@ -62,6 +62,8 @@ INCPRE+=$(SOLARVER)$/$(INPATH)$/inc$/lcms2
+ TARFILE_NAME=libcdr-0.0.9
+ TARFILE_MD5=3c0037fb07dea2f0bbae8386fa7c6a9a
+
++PATCH_FILES=libcdr-issupported-exception.patch.1
++
+ BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
+ BUILD_DIR=src$/lib
+
+--
+1.7.11.7
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 20c41cb..3c40c2d 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -249,6 +249,7 @@ Patch28: 0001-split-qnametostr-up-to-try-and-make-.o-s-small-enoug.patch
Patch29: libreoffice-rhel6gcj.patch
Patch30: libreoffice-rhel6poppler.patch
Patch31: libreoffice-rhel6langs.patch
+Patch32: 0001-rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch
%endif
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
@@ -992,6 +993,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch29 -p1 -b .rhel6gcj.patch
%patch30 -p1 -b .rhel6poppler.patch
%patch31 -p1 -b .rhel6langs.patch
+%patch32 -p1 -b .rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch
%endif
# TODO: check this
@@ -2260,6 +2262,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
+* Thu Nov 29 2012 David Tardon <dtardon at redhat.com> - 1:3.6.4.3-2-UNBUILT
+- Resolves: rhbz#891082 catch libcdr exceptions
+
* Thu Nov 29 2012 David Tardon <dtardon at redhat.com> - 1:3.6.4.3-1
- 3.6.4 rc3
More information about the scm-commits
mailing list