external/freetype/UnpackedTarball_freetype.mk | 3 +++ external/freetype/ubsan.patch | 12 ++++++++++++ 2 files changed, 15 insertions(+)
New commits: commit 709973084ef694f98076e6d4cbac7135722a8517 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Nov 17 16:54:09 2022 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Nov 21 11:17:51 2022 +0100 exteral/freetype: -fsanitize=non-null-attribute Crashreport log: workdir/UnpackedTarball/freetype/src/psaux/psobjs.c:204:5: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/string.h:44:28: note: nonnull attribute specified here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior workdir/UnpackedTarball/freetype/src/psaux/psobjs.c:204:5 in Change-Id: Ib2ae396ba640129a8bc1c937ce41a38b6279a2ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142894 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tor Lillqvist <t...@collabora.com> diff --git a/external/freetype/UnpackedTarball_freetype.mk b/external/freetype/UnpackedTarball_freetype.mk index 0b521cb934d0..8a6c7f852242 100644 --- a/external/freetype/UnpackedTarball_freetype.mk +++ b/external/freetype/UnpackedTarball_freetype.mk @@ -14,6 +14,9 @@ $(eval $(call gb_UnpackedTarball_set_tarball,freetype,$(FREETYPE_TARBALL),,freet $(eval $(call gb_UnpackedTarball_add_patches,freetype,\ external/freetype/freetype-2.6.5.patch.1 \ external/freetype/freetype-fd-hack.patch.0 \ + external/freetype/ubsan.patch \ )) +$(eval $(call gb_UnpackedTarball_set_patchlevel,freetype,0)) + # vim: set noet sw=4 ts=4: diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch new file mode 100644 index 000000000000..4a743f3ef3f6 --- /dev/null +++ b/external/freetype/ubsan.patch @@ -0,0 +1,12 @@ +--- src/psaux/psobjs.c.orig 2022-11-17 16:52:21.913211573 +0100 ++++ src/psaux/psobjs.c 2022-11-17 16:53:17.905127207 +0100 +@@ -201,7 +201,8 @@ + /* add the object to the base block and adjust offset */ + table->elements[idx] = FT_OFFSET( table->block, table->cursor ); + table->lengths [idx] = length; +- FT_MEM_COPY( table->block + table->cursor, object, length ); ++ if (table->block + table->cursor) ++ FT_MEM_COPY( table->block + table->cursor, object, length ); + + table->cursor += length; + return FT_Err_Ok;