Kaydet (Commit) bdc74dc2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid -fsanitize=nullability in external/zlib

...as seen during CppunitTest_sw_layoutwriter:

> testUserFieldTypeLanguage::TestBody finished in: 1271ms
[...]
> workdir/UnpackedTarball/zlib/trees.c:873:42: runtime error: null pointer passed as argument 2, which is declared to never be null
> /usr/include/string.h:43:28: note: nonnull attribute specified here
>  #0 in _tr_stored_block at workdir/UnpackedTarball/zlib/trees.c:873:5
>  #1 in deflate at workdir/UnpackedTarball/zlib/deflate.c:1025:17
>  #2 in ZipUtils::ThreadedDeflater::Task::doWork() at package/source/zipapi/ThreadedDeflater.cxx:163:15
[...]

Change-Id: I7d4b68ab2c4fb3080fc48211236cb33ca4bf7126
Reviewed-on: https://gerrit.libreoffice.org/73143
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 0e296d25
...@@ -16,4 +16,10 @@ $(eval $(call gb_UnpackedTarball_set_post_action,zlib,\ ...@@ -16,4 +16,10 @@ $(eval $(call gb_UnpackedTarball_set_post_action,zlib,\
cp $(addsuffix .c,adler32 compress crc32 deflate inffast inflate inftrees trees zutil) x64 \ cp $(addsuffix .c,adler32 compress crc32 deflate inffast inflate inftrees trees zutil) x64 \
)) ))
$(eval $(call gb_UnpackedTarball_set_patchlevel,zlib,0))
$(eval $(call gb_UnpackedTarball_add_patches,zlib, \
external/zlib/ubsan.patch \
))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
--- trees.c
+++ trees.c
@@ -870,7 +870,7 @@
bi_windup(s); /* align on byte boundary */
put_short(s, (ush)stored_len);
put_short(s, (ush)~stored_len);
- zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
+ if (stored_len != 0) zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
s->pending += stored_len;
#ifdef ZLIB_DEBUG
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment