svn commit: r450394 - head/security/clamav/files
Larry Rosenman
ler at FreeBSD.org
Fri Sep 22 16:11:56 UTC 2017
Author: ler
Date: Fri Sep 22 16:11:54 2017
New Revision: 450394
URL: https://svnweb.freebsd.org/changeset/ports/450394
Log:
security/clamav: Compile-time test fails during portinstall
Apply patch from upstream.
PR: 221513
Submitted by: jny at jny.dk, fsbruva at yahoo.com
Added:
head/security/clamav/files/patch-libclamav_bytecode__api.c (contents, props changed)
head/security/clamav/files/patch-libclamav_c++_llvm_include_llvm_Support_CFG.h (contents, props changed)
Deleted:
head/security/clamav/files/patch-libclamav-c++-llvm
Modified:
head/security/clamav/files/patch-configure
Modified: head/security/clamav/files/patch-configure
==============================================================================
--- head/security/clamav/files/patch-configure Fri Sep 22 16:00:05 2017 (r450393)
+++ head/security/clamav/files/patch-configure Fri Sep 22 16:11:54 2017 (r450394)
@@ -12,15 +12,6 @@
fi
if test -n "$vuln"; then
-@@ -20758,7 +20758,7 @@ $as_echo "#define C_BSD 1" >>confdefs.h
- ;;
- freebsd*)
- if test "$have_pthreads" = "yes"; then
-- THREAD_LIBS="-lthr"
-+ THREAD_LIBS="%%PTHREAD_LIBS%%"
- TH_SAFE="-thread-safe"
- fi
-
@@ -20934,7 +20934,7 @@ esac
if test "$have_milter" = "yes"; then
Added: head/security/clamav/files/patch-libclamav_bytecode__api.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/security/clamav/files/patch-libclamav_bytecode__api.c Fri Sep 22 16:11:54 2017 (r450394)
@@ -0,0 +1,44 @@
+--- libclamav/bytecode_api.c.orig 2016-04-22 15:02:19 UTC
++++ libclamav/bytecode_api.c
+@@ -811,8 +811,19 @@ int32_t cli_bcapi_inflate_init(struct cli_bc_ctx *ctx,
+ 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");
+@@ -830,19 +841,6 @@ int32_t cli_bcapi_inflate_init(struct cli_bc_ctx *ctx,
+ 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;
+ }
+
Added: head/security/clamav/files/patch-libclamav_c++_llvm_include_llvm_Support_CFG.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/security/clamav/files/patch-libclamav_c++_llvm_include_llvm_Support_CFG.h Fri Sep 22 16:11:54 2017 (r450394)
@@ -0,0 +1,62 @@
+--- libclamav/c++/llvm/include/llvm/Support/CFG.h.orig 2016-04-22 15:02:19 UTC
++++ libclamav/c++/llvm/include/llvm/Support/CFG.h
+@@ -27,8 +27,9 @@ namespace llvm {
+
+ template <class Ptr, class USE_iterator> // Predecessor Iterator
+ class PredIterator : public std::iterator<std::forward_iterator_tag,
+- Ptr, ptrdiff_t> {
+- typedef std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t> super;
++ Ptr, ptrdiff_t, Ptr*, Ptr*> {
++ typedef std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t, Ptr*,
++ Ptr*> super;
+ typedef PredIterator<Ptr, USE_iterator> Self;
+ USE_iterator It;
+
+@@ -40,6 +41,7 @@ class PredIterator : public std::iterator<std::forward
+
+ public:
+ typedef typename super::pointer pointer;
++ typedef typename super::reference reference;
+
+ explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
+ advancePastNonTerminators();
+@@ -49,7 +51,7 @@ class PredIterator : public std::iterator<std::forward
+ inline bool operator==(const Self& x) const { return It == x.It; }
+ inline bool operator!=(const Self& x) const { return !operator==(x); }
+
+- inline pointer operator*() const {
++ inline reference operator*() const {
+ assert(!It.atEnd() && "pred_iterator out of range!");
+ return cast<TerminatorInst>(*It)->getParent();
+ }
+@@ -87,10 +89,11 @@ inline const_pred_iterator pred_end(const BasicBlock *
+
+ template <class Term_, class BB_> // Successor Iterator
+ class SuccIterator : public std::iterator<std::bidirectional_iterator_tag,
+- BB_, ptrdiff_t> {
++ BB_, ptrdiff_t, BB_*, BB_*> {
+ const Term_ Term;
+ unsigned idx;
+- typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> super;
++ typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t, BB_*,
++ BB_*> super;
+ typedef SuccIterator<Term_, BB_> Self;
+
+ inline bool index_is_valid(int idx) {
+@@ -99,6 +102,7 @@ class SuccIterator : public std::iterator<std::bidirec
+
+ public:
+ typedef typename super::pointer pointer;
++ typedef typename super::reference reference;
+ // TODO: This can be random access iterator, only operator[] missing.
+
+ explicit inline SuccIterator(Term_ T) : Term(T), idx(0) {// begin iterator
+@@ -122,7 +126,7 @@ class SuccIterator : public std::iterator<std::bidirec
+ inline bool operator==(const Self& x) const { return idx == x.idx; }
+ inline bool operator!=(const Self& x) const { return !operator==(x); }
+
+- inline pointer operator*() const { return Term->getSuccessor(idx); }
++ inline reference operator*() const { return Term->getSuccessor(idx); }
+ inline pointer operator->() const { return operator*(); }
+
+ inline Self& operator++() { ++idx; return *this; } // Preincrement
More information about the svn-ports-all
mailing list