diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-12-24 12:26:29 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-12-26 11:03:47 +0000 |
commit | 3e95c29d526fb57bd22615f0ba2e3d814a5edc7d (patch) | |
tree | a023b4df6d5fe81ed4b191d17f73b5ed8250caff /external | |
parent | f15c35d8daa71ce2a1388ffe46776900c1ffee35 (diff) |
external/libvisio: Avoid undefined behavior
Change-Id: I454cf3b102986f2e3c1905f5fe0e1b2bb427828e
(cherry picked from commit 171393c7a497690b3c2a8614a6250ca9e3bf676d)
Reviewed-on: https://gerrit.libreoffice.org/20953
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/libvisio/UnpackedTarball_libvisio.mk | 4 | ||||
-rw-r--r-- | external/libvisio/ubsan.patch | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/external/libvisio/UnpackedTarball_libvisio.mk b/external/libvisio/UnpackedTarball_libvisio.mk index f9467c531296..aa8b48fb40b9 100644 --- a/external/libvisio/UnpackedTarball_libvisio.mk +++ b/external/libvisio/UnpackedTarball_libvisio.mk @@ -13,6 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libvisio,$(VISIO_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,libvisio,0)) +$(eval $(call gb_UnpackedTarball_add_patches,libvisio, \ + external/libvisio/ubsan.patch \ +)) + ifeq ($(COM_IS_CLANG),TRUE) ifneq ($(filter -fsanitize=%,$(CC)),) $(eval $(call gb_UnpackedTarball_add_patches,libvisio, \ diff --git a/external/libvisio/ubsan.patch b/external/libvisio/ubsan.patch new file mode 100644 index 000000000000..d80f7ebe5bbe --- /dev/null +++ b/external/libvisio/ubsan.patch @@ -0,0 +1,10 @@ +--- src/lib/VSDContentCollector.cpp ++++ src/lib/VSDContentCollector.cpp +@@ -3285,6 +3285,7 @@ + _handleLevelChange(level); + librevenge::RVNGString text; + std::vector<unsigned char> tmpData(layerMem.m_data.size()); ++ if (!layerMem.m_data.empty()) + memcpy(&tmpData[0], layerMem.m_data.getDataBuffer(), layerMem.m_data.size()); + appendCharacters(text, tmpData, layerMem.m_format); + |