summaryrefslogtreecommitdiff
path: root/external/libetonyek
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-18 21:11:13 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-19 09:54:19 +0100
commite8cee7877823003e05e29f76187ea574610ef979 (patch)
tree951e251678a6eaeadd649c59d295286c8c36244d /external/libetonyek
parentf9de7c851ed0326177f3f77af855bfc13b62cecd (diff)
forcepoint#77 null-deref
Change-Id: Ib4d546f1e44eb6a682ec7cbbaab7a0a2050ffa1c Reviewed-on: https://gerrit.libreoffice.org/65377 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'external/libetonyek')
-rw-r--r--external/libetonyek/UnpackedTarball_libetonyek.mk1
-rw-r--r--external/libetonyek/forcepoint.parsepath.null.deref.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk
index d90e44955687..eb38615ffe31 100644
--- a/external/libetonyek/UnpackedTarball_libetonyek.mk
+++ b/external/libetonyek/UnpackedTarball_libetonyek.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\
external/libetonyek/rpath.patch \
external/libetonyek/warnings.patch \
external/libetonyek/initial-creator.patch.1 \
+ external/libetonyek/forcepoint.parsepath.null.deref.patch \
))
ifneq ($(OS),MACOSX)
diff --git a/external/libetonyek/forcepoint.parsepath.null.deref.patch b/external/libetonyek/forcepoint.parsepath.null.deref.patch
new file mode 100644
index 000000000000..2cdf6a5a34c2
--- /dev/null
+++ b/external/libetonyek/forcepoint.parsepath.null.deref.patch
@@ -0,0 +1,44 @@
+diff -ru src/lib/IWAParser.cpp libetonyek/src/lib/IWAParser.cpp
+--- src/lib/IWAParser.cpp 2018-12-18 21:02:45.772942197 +0000
++++ src/lib/IWAParser.cpp 2018-12-18 21:05:04.758548097 +0000
+@@ -998,7 +998,14 @@
+ if (get(type) == 1)
+ path->appendMoveTo(get(coords).m_x, get(coords).m_y);
+ else
++ {
++ if (path->empty())
++ {
++ ETONYEK_DEBUG_MSG(("IWAParser::parsePath: missing prior MoveTo subsequent LineTo\n", get(type) == 1 ? 'M' : 'L'));
++ return false;
++ }
+ path->appendLineTo(get(coords).m_x, get(coords).m_y);
++ }
+ break;
+ }
+ case 4 :
+diff -ru src/lib/IWORKPath.cpp libetonyek/src/lib/IWORKPath.cpp
+--- src/lib/IWORKPath.cpp 2018-12-18 21:02:45.775942059 +0000
++++ src/lib/IWORKPath.cpp 2018-12-18 21:03:39.289480143 +0000
+@@ -594,6 +594,11 @@
+ m_impl->m_closed = false;
+ }
+
++bool IWORKPath::empty() const
++{
++ return m_impl->m_path.empty();
++}
++
+ void IWORKPath::appendMoveTo(const double x, const double y)
+ {
+ if (!m_impl->m_path.empty() && m_impl->m_path.back().size()<=1)
+diff -ru src/lib/IWORKPath.h libetonyek/src/lib/IWORKPath.h
+--- src/lib/IWORKPath.h 2018-12-18 21:02:45.772942197 +0000
++++ src/lib/IWORKPath.h 2018-12-18 21:05:48.323543888 +0000
+@@ -42,6 +42,7 @@
+ void swap(IWORKPath &other);
+
+ void clear();
++ bool empty() const;
+
+ void appendMoveTo(double x, double y);
+ void appendLineTo(double x, double y);