summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-11-23 08:13:44 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-11-23 09:06:33 +0100
commit5c85fc8552e8ce811833351b68b3d70b9bb6bf4f (patch)
treedb8c369d2734eabc7035df1aca8ef05837bd0cf8
parent7255d21f812b7333c83b4548e2b5b102adb606a9 (diff)
exteral/freetype: improve -fsanitize=non-null-attribute fix
Quoting <https://gerrit.libreoffice.org/c/core/+/143098/2#message-62ac4499370dd88eeb3181f52d817e831150c94d>: > What we do in other such cases is not make it conditional on the > pointer argument being non-null, but rather make it conditional on the > length argument not being zero. That way, it only catches the > "harmless" case of an "irrelevant" null pointer in combination with a > zero length, and doesn't hide bugs where the pointer is erroneously null > while the length is non-zero. So check for the length and not for the pointer argument. Change-Id: I1894eb67d49a9ae40cdce29de865172400a271dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143134 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--external/freetype/ubsan.patch2
1 files changed, 1 insertions, 1 deletions
diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch
index 62d31f5d3be9..b27bbba09cb8 100644
--- a/external/freetype/ubsan.patch
+++ b/external/freetype/ubsan.patch
@@ -16,7 +16,7 @@
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)
++ if (length != 0)
+ FT_MEM_COPY( table->block + table->cursor, object, length );
table->cursor += length;