summaryrefslogtreecommitdiff
path: root/app-antivirus/clamav/files
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2018-03-30 00:41:57 +0200
committerThomas Deutschmann <whissi@gentoo.org>2018-03-30 00:42:18 +0200
commit6c8c54a1663246d42c8fda0de366a3078a02be13 (patch)
treeee1c927f69dcc6f63cc1bb0e49d5a48c836e08ea /app-antivirus/clamav/files
parent8666bb631d19900bcf4f8fa1ff65d6a42d7bc288 (diff)
downloadgentoo-6c8c54a1663246d42c8fda0de366a3078a02be13.tar.gz
gentoo-6c8c54a1663246d42c8fda0de366a3078a02be13.tar.xz
app-antivirus/clamav: Make clamav work with >=zlib-1.2.9
..in addition, an automagic on dev-libs/check was fixed. Closes: https://bugs.gentoo.org/649516 Package-Manager: Portage-2.3.26, Repoman-2.3.7
Diffstat (limited to 'app-antivirus/clamav/files')
-rw-r--r--app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch b/app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch
new file mode 100644
index 00000000000..18673419a58
--- /dev/null
+++ b/app-antivirus/clamav/files/clamav-0.99.4-fix-newer-zlib.patch
@@ -0,0 +1,54 @@
+https://bugs.gentoo.org/649516
+
+Description: fix compatibility with zlib 1.2.9 and newer
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/1692073
+
+Index: clamav-0.99.2+dfsg/libclamav/bytecode_api.c
+===================================================================
+--- clamav-0.99.2+dfsg.orig/libclamav/bytecode_api.c 2017-08-08 15:20:06.651685637 -0400
++++ clamav-0.99.2+dfsg/libclamav/bytecode_api.c 2017-08-15 15:45:14.645714766 -0400
+@@ -811,8 +811,20 @@ int32_t cli_bcapi_inflate_init(struct cl
+ cli_dbgmsg("bytecode api: inflate_init: invalid buffers!\n");
+ return -1;
+ }
+- memset(&stream, 0, sizeof(stream));
+- ret = inflateInit2(&stream, windowBits);
++
++ b = cli_realloc(ctx->inflates, sizeof(*ctx->inflates)*n);
++ if (!b) {
++ return -1;
++ }
++ ctx->inflates = b;
++ ctx->ninflates = n;
++ b = &b[n-1];
++
++ b->from = from;
++ b->to = to;
++ b->needSync = 0;
++ memset(&b->stream, 0, sizeof(stream));
++ ret = inflateInit2(&b->stream, windowBits);
+ switch (ret) {
+ case Z_MEM_ERROR:
+ cli_dbgmsg("bytecode api: inflateInit2: out of memory!\n");
+@@ -829,20 +841,6 @@ int32_t cli_bcapi_inflate_init(struct cl
+ cli_dbgmsg("bytecode api: inflateInit2: unknown error %d\n", ret);
+ return -1;
+ }
+-
+- b = cli_realloc(ctx->inflates, sizeof(*ctx->inflates)*n);
+- if (!b) {
+- inflateEnd(&stream);
+- return -1;
+- }
+- ctx->inflates = b;
+- ctx->ninflates = n;
+- b = &b[n-1];
+-
+- b->from = from;
+- b->to = to;
+- b->needSync = 0;
+- memcpy(&b->stream, &stream, sizeof(stream));
+ return n-1;
+ }
+