summaryrefslogtreecommitdiff
path: root/external/liborcus
diff options
context:
space:
mode:
Diffstat (limited to 'external/liborcus')
-rw-r--r--external/liborcus/UnpackedTarball_liborcus.mk1
-rw-r--r--external/liborcus/fix-crash-ooo55043-1.patch.017
2 files changed, 18 insertions, 0 deletions
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index e242cfc42c9f..f2780494bd7f 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,liborcus,1))
$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/0001-workaround-a-linking-problem-on-windows.patch \
external/liborcus/rpath.patch.0 \
+ external/liborcus/fix-crash-ooo55043-1.patch.0 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/liborcus/fix-crash-ooo55043-1.patch.0 b/external/liborcus/fix-crash-ooo55043-1.patch.0
new file mode 100644
index 000000000000..58a97c04424d
--- /dev/null
+++ b/external/liborcus/fix-crash-ooo55043-1.patch.0
@@ -0,0 +1,17 @@
+--- src/parser/zip_archive_stream.cpp
++++ src/parser/zip_archive_stream.cpp
+@@ -91,8 +91,13 @@
+
+ void zip_archive_stream_blob::read(unsigned char* buffer, size_t length) const
+ {
++ if (!length)
++ return;
+ // First, make sure we have enough blob to satisfy the requested stream length.
+- size_t length_available = m_size - tell();
++ const size_t pos = tell();
++ if (pos > m_size)
++ throw zip_error("Stream is seeked past end. No data available");
++ const size_t length_available = m_size - pos;
+ if (length_available < length)
+ throw zip_error("There is not enough stream left to fill requested length.");
+