[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#951871: buster-pu: package clamav/0.102.2+dfsg-0+deb10u1



Package: release.debian.org
User: release.debian.org@packages.debian.org
Usertags: pu
Tags: buster
Severity: normal

ClamAV upstream released 0.102.2 which is a stable / security update
including a fix for CVE-2020-3123.
I tried to trimm the diff, it got cluttered a lot by the important
s/2019/2020 related change in the copyright line in each source file…

Unstable had 0.102.2+dfsg-1 for a long time which was basically this
version. -2 landed in unstable recently and has additionaly a change to
freshclam to allow to set curl's CURL_CA_BUNDLE variable in order to
specify the CA bundle if the ca-certificates package is not around.
This upstream update also contains this update.
I had this version running on one of my machines for almost a week.

Sebastian
diff --git a/NEWS.md b/NEWS.md
index e07a28c..82b22f5 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -3,6 +3,61 @@
 Note: This file refers to the source tarball. Things described here may differ
  slightly from the binary packages.
 
+## 0.102.2
+
+ClamAV 0.102.2 is a bug patch release to address the following issues.
+
+- [CVE-2020-3123](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-3123):
+  An Denial-of-Service (DoS) condition may occur when using the optional credit
+  card data-loss-prevention (DLP) feature. Improper bounds checking of an
+  unsigned variable resulted in an out-of-bounds read which causes a crash.
+
+- Significantly improved scan speed of PDF files on Windows.
+
+- Re-applied a fix to alleviate file access issues when scanning RAR files in
+  downstream projects that use libclamav where the scanning engine is operating
+  in a low-privelege process. This bug was originally fixed in 0.101.2 and the
+  fix was mistakenly omitted from 0.102.0.
+
+- Fixed an issue wherein freshclam failed to update if the database version
+  downloaded is 1 version older than advertised. This situation may occur after
+  a new database version is published. The issue affected users downloading the
+  whole CVD database file.
+
+- Changed the default freshclam ReceiveTimeout setting to 0 (infinite).
+  The ReceiveTimeout had caused needless database update failures for users with
+  slower internet connections.
+
+- Correctly display number of kilobytes (KiB) in progress bar and reduced the
+  size of the progress bar to accomodate 80-char width terminals.
+
+- Fixed an issue where running freshclam manually causes a daemonized freshclam
+  process to fail when it updates because the manual instance deletes the
+  temporary download directory. Freshclam temporary files will now download to a
+  unique directory created at the time of an update instead of using a hardcoded
+  directory created/destroyed at the program start/exit.
+
+- Fix for Freshclam's OnOutdatedExecute config option.
+
+- Fixes a memory leak in the error condition handling for the email parser.
+
+- Improved bound checking and error handling in ARJ archive parser.
+
+- Improved error handling in PDF parser.
+
+- Fix for memory leak in byte-compare signature handler.
+
+- Updates to the unit test suite to support libcheck 0.13.
+
+- Updates to support autoconf 2.69 and automake 1.15.
+
+Special thanks to the following for code contributions and bug reports:
+
+- Antoine Deschênes
+- Eric Lindblad
+- Gianluigi Tiesi
+- Tuomo Soini
+
 ## 0.102.1
 
 ClamAV 0.102.1 is a security patch release to address the following issues.
@@ -189,6 +244,92 @@ and for working diligently to ensure knowledge transfer up until his last day
 on the team. Working with you was a pleasure, Joe, and we wish you the best
 of luck in your next adventure!
 
+## 0.101.5
+
+ClamAV 0.101.5 is a security patch release that addresses the following issues.
+
+- Fix for the following vulnerability affecting 0.102.0 and 0.101.4 and prior:
+  - [CVE-2019-15961](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15961)
+    A Denial-of-Service (DoS) vulnerability may occur when scanning a specially
+    crafted email file as a result of excessively long scan times. The issue is
+    resolved by implementing several maximums in parsing MIME messages and by
+    optimizing use of memory allocation.
+
+- Added the zip scanning improvements found in v0.102.0 where it scans files
+  using zip records from a sorted catalogue which provides deduplication of
+  file records resulting in faster extraction and scan time and reducing the
+  likelihood of alerting on non-malicious duplicate file entries as overlapping
+  files.
+
+- Signature load time is significantly reduced by changing to a more efficient
+  algorithm for loading signature patterns and allocating the AC trie.
+  Patch courtesy of Alberto Wu.
+
+- Introduced a new configure option to statically link libjson-c with libclamav.
+  Static linking with libjson is highly recommended to prevent crashes in
+  applications that use libclamav alongside another JSON parsing library.
+
+- Null-dereference fix in email parser when using the `--gen-json` metadata
+  option.
+
+Special thanks to the following for code contributions and bug reports:
+
+- Alberto Wu
+- Joran Dirk Greef
+
+## 0.101.4
+
+ClamAV 0.101.4 is a security patch release that addresses the following issues.
+
+- An out of bounds write was possible within ClamAV's NSIS bzip2 library when
+  attempting decompression in cases where the number of selectors exceeded the
+  max limit set by the library (CVE-2019-12900). The issue has been resolved
+  by respecting that limit.
+
+  Thanks to Martin Simmons for reporting the issue [here](https://bugzilla.clamav.net/show_bug.cgi?id=12371)
+
+- The zip bomb vulnerability mitigated in 0.101.3 has been assigned the
+  CVE identifier CVE-2019-12625. Unfortunately, a workaround for the zip-bomb
+  mitigation was immediately identified. To remediate the zip-bomb scantime
+  issue, a scan time limit has been introduced in 0.101.4. This limit now
+  resolves ClamAV's vulnerability to CVE-2019-12625.
+
+  The default scan time limit is 2 minutes (120000 milliseconds).
+
+  To customize the time limit:
+
+  - use the `clamscan` `--max-scantime` option
+  - use the `clamd` `MaxScanTime` config option
+
+  Libclamav users may customize the time limit using the `cl_engine_set_num`
+  function. For example:
+
+  ```c
+      cl_engine_set_num(engine, CL_ENGINE_MAX_SCANTIME, time_limit_milliseconds)
+  ```
+
+  Thanks to David Fifield for reviewing the zip-bomb mitigation in 0.101.3
+  and reporting the issue.
+
+## 0.101.3
+
+ClamAV 0.101.3 is a patch release to address a vulnerability to non-recursive
+zip bombs.
+
+A Denial-of-Service (DoS) vulnerability may occur when scanning a zip bomb as a
+result of excessively long scan times. The issue is resolved by detecting the
+overlapping local file headers which characterize the non-recursive zip bomb
+described by David Fifield,
+[here](https://www.bamsoftware.com/hacks/zipbomb/).
+
+Thank you to Hanno Böck for reporting the issue as it relates to ClamAV,
+[here](https://bugzilla.clamav.net/show_bug.cgi?id=12356).
+
+Also included in 0.101.3:
+
+- Update of bundled the libmspack library from 0.8alpha to 0.10alpha, to
+  address a buffer overflow vulnerability in libmspack < 0.9.1α.
+
 ## 0.101.2
 
 ClamAV 0.101.2 is a patch release to address a handful of security related bugs.
diff --git a/clamd/scanner.c b/clamd/scanner.c
index ed6f3c3..b09b09f 100644
--- a/clamd/scanner.c
+++ b/clamd/scanner.c
@@ -391,7 +391,7 @@ int scanfd(
     context.filename = fdstr;
     context.virsize  = 0;
     context.scandata = NULL;
-    ret              = cl_scandesc_callback(fd, NULL, &virname, scanned, engine, options, &context);
+    ret              = cl_scandesc_callback(fd, conn->filename, &virname, scanned, engine, options, &context);
     thrmgr_setactivetask(NULL, NULL);
 
     if (thrmgr_group_need_terminate(conn->group)) {
@@ -564,7 +564,7 @@ int scanstream(
         context.filename = peer_addr;
         context.virsize  = 0;
         context.scandata = NULL;
-        ret              = cl_scandesc_callback(tmpd, NULL, &virname, scanned, engine, options, &context);
+        ret              = cl_scandesc_callback(tmpd, tmpname, &virname, scanned, engine, options, &context);
         thrmgr_setactivetask(NULL, NULL);
     } else {
         ret = -1;
diff --git a/clamsubmit/clamsubmit.c b/clamsubmit/clamsubmit.c
index 1e569a4..13b81e3 100644
--- a/clamsubmit/clamsubmit.c
+++ b/clamsubmit/clamsubmit.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #if HAVE_UNISTD_H
@@ -145,6 +146,18 @@ const char *presigned_get_string(json_object *ps_json_obj, char *key)
     return json_str;
 }
 
+static void set_tls_ca_bundle(CURL *curl)
+{
+	char *ca_bundle;
+
+	ca_bundle = secure_getenv("CURL_CA_BUNDLE");
+	if (!ca_bundle)
+		return;
+
+	if (curl_easy_setopt(curl, CURLOPT_CAINFO, ca_bundle) != CURLE_OK)
+		fprintf(stderr, "Failed to set CURLOPT_CAINFO!\n");
+}
+
 int main(int argc, char *argv[])
 {
     int status = 1;
@@ -186,6 +199,7 @@ int main(int argc, char *argv[])
     if (CURLE_OK != curl_easy_setopt(clam_curl, CURLOPT_USERAGENT, userAgent)) {
         fprintf(stderr, "!create_curl_handle: Failed to set CURLOPT_USERAGENT (%s)!\n", userAgent);
     }
+    set_tls_ca_bundle(clam_curl);
 
     while ((ch = my_getopt(argc, argv, OPTS)) > 0) {
         switch (ch) {
@@ -398,6 +412,7 @@ int main(int argc, char *argv[])
     if (CURLE_OK != curl_easy_setopt(aws_curl, CURLOPT_USERAGENT, userAgent)) {
         fprintf(stderr, "!create_curl_handle: Failed to set CURLOPT_USERAGENT (%s)!\n", userAgent);
     }
+    set_tls_ca_bundle(aws_curl);
 
     if (g_debug) {
         /* ask libcurl to show us the verbose output */
diff --git a/configure.ac b/configure.ac
index 0bcba7a..8617ea6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,9 +22,7 @@ AC_PREREQ([2.59])
 
 dnl For a release change [devel] to the real version [0.xy]
 dnl also change VERSION below
-AC_INIT([ClamAV], [0.102.1], [https://bugzilla.clamav.net/], [clamav], [https://www.clamav.net/])
-dnl put configure auxiliary into config
-AC_CONFIG_AUX_DIR([config])
+AC_INIT([ClamAV], [0.102.2], [https://bugzilla.clamav.net/], [clamav], [https://www.clamav.net/])
 
 dnl put configure auxiliary into config
 AC_CONFIG_AUX_DIR([config])
@@ -44,13 +42,12 @@ dnl -Wall and -Werror here are NOT CFLAGS, they refer to automake warnings
 dnl enable stealth builds and psychedelic tests
 AM_INIT_AUTOMAKE([1.11 -Wall -Wportability -Wno-override std-options foreign dist-bzip2 no-define color-tests parallel-tests tar-ustar])
 AM_SILENT_RULES([yes])
-
+AC_USE_SYSTEM_EXTENSIONS
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 
 dnl we told automake to not define these, since we want to include
 dnl the date in the version
 AC_DEFINE([PACKAGE], PACKAGE_NAME, [Name of package])
-AC_USE_SYSTEM_EXTENSIONS
 
 m4_include([m4/reorganization/version.m4])
 
diff --git a/debian/changelog b/debian/changelog
index 09f6c87..a76b6d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+clamav (0.102.2+dfsg-0+deb10u1) buster; urgency=medium
+
+  * Import 0.102.2
+    - CVE-2020-3123 (DoS may occur in the optional DLP feature)
+      (Closes: 950944).
+  * Update symbol file.
+  * Set ReceiveTimeout to 0 which is upstream default.
+  * Add a patch to let freshclam consider CURL_CA_BUNDLE environment variable
+    to set the CA bundle (like curl does) (Closes: #951057).
+  * Recommend ca-certificates, new freshclash uses https by default.
+
+ -- Sebastian Andrzej Siewior <sebastian@breakpoint.cc>  Sat, 22 Feb 2020 14:39:45 +0100
+
 clamav (0.102.1+dfsg-0+deb10u2) buster; urgency=medium
 
   * clamav-daemon: Correct error from ScanOnAccess option removal so that
@@ -96,7 +109,7 @@ clamav (0.101.1+dfsg-1) experimental; urgency=medium
   * Load the apparmor profile before starting the daemon. Thanks to intrigeri
     for the help (Closes: #903834).
   * Add attach_disconnected to freshclam's apparmor profile to hopefully get
-    it properly working in overlayfs enviroment. Thanks to Vincas Dargis
+    it properly working in overlayfs environment. Thanks to Vincas Dargis
     (Closes: #917648).
 
  -- Sebastian Andrzej Siewior <sebastian@breakpoint.cc>  Fri, 11 Jan 2019 23:00:17 +0100
diff --git a/debian/clamav-freshclam.postinst.in b/debian/clamav-freshclam.postinst.in
index f91c432..ecc7edc 100644
--- a/debian/clamav-freshclam.postinst.in
+++ b/debian/clamav-freshclam.postinst.in
@@ -212,7 +212,7 @@ case "$1" in
   [ -z "$Foreground" ] && Foreground=false
   [ -z "$Debug" ] && Debug=false
   [ -z "$ConnectTimeout" ] && ConnectTimeout=30
-  [ -z "$ReceiveTimeout" ] && ReceiveTimeout=30
+  [ -z "$ReceiveTimeout" ] && ReceiveTimeout=0
   [ -z "$TestDatabases" ] && TestDatabases=yes
 
   # Generate config file
diff --git a/debian/control b/debian/control
index 596a137..fa69dd3 100644
--- a/debian/control
+++ b/debian/control
@@ -221,6 +221,7 @@ Architecture: any
 Conflicts: clamav-data, libclamav2, libclamav3
 Provides: clamav-data
 Suggests: apparmor, clamav-docs
+Recommends: ca-certificates
 Depends: clamav-base (>= ${source:Version}),
          dpkg (>= 1.16.1),
          logrotate,
diff --git a/debian/copyright b/debian/copyright
index 3e0dd17..c758c0a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -88,20 +88,18 @@ License: GPL-2 with OpenSSL exception
  clamd/thrmgr.h
  clamdscan/Makefile.am
  clamscan/Makefile.am
+ clamscan/manager.c
+ clamscan/manager.h
  database/Makefile.am
  docs/Makefile.am
  etc/Makefile.am
  examples/ex1.c
- freshclam/dns.c
- freshclam/dns.h
+ freshclam/Makefile.am
  freshclam/execute.c
  freshclam/execute.h
- freshclam/freshclamcodes.h
- freshclam/Makefile.am
- freshclam/manager.c
- freshclam/manager.h
- freshclam/nonblock.c
- freshclam/nonblock.h
+ libfreshclam/dns.c
+ libfreshclam/dns.h
+ libfreshclam/Makefile.am
  libclamav/Makefile.am
  libclamav/c++/configure.ac
  libclamav/c++/Makefile.am
@@ -276,8 +274,8 @@ License: LGPL-2+ with Libtool exception
 License: LGPL-2.1
 
 Files:
- clamd/fts.c
- clamd/priv_fts.h
+ clamonacc/misc/fts.c
+ clamonacc/misc/priv_fts.h
 Copyright:
  1990, 1993-1994, The Regents of the University of California.
  1994-2015, Free Software Foundation, Inc.
diff --git a/debian/libclamav9.symbols b/debian/libclamav9.symbols
index 465436c..54d3eec 100644
--- a/debian/libclamav9.symbols
+++ b/debian/libclamav9.symbols
@@ -1,20 +1,20 @@
 libclamav.so.9 libclamav9 #MINVER#
 * Build-Depends-Package: libclamav-dev
- CLAMAV_PRIVATE@CLAMAV_PRIVATE 0.102.1
+ CLAMAV_PRIVATE@CLAMAV_PRIVATE 0.102.2
  CLAMAV_PUBLIC@CLAMAV_PUBLIC 0.101.0
- __cli_strcasestr@CLAMAV_PRIVATE 0.102.1
- __cli_strndup@CLAMAV_PRIVATE 0.102.1
- __cli_strnlen@CLAMAV_PRIVATE 0.102.1
- __cli_strnstr@CLAMAV_PRIVATE 0.102.1
- base64Flush@CLAMAV_PRIVATE 0.102.1
- blobAddData@CLAMAV_PRIVATE 0.102.1
- blobCreate@CLAMAV_PRIVATE 0.102.1
- blobDestroy@CLAMAV_PRIVATE 0.102.1
- cl_ASN1_GetTimeT@CLAMAV_PRIVATE 0.102.1
+ __cli_strcasestr@CLAMAV_PRIVATE 0.102.2
+ __cli_strndup@CLAMAV_PRIVATE 0.102.2
+ __cli_strnlen@CLAMAV_PRIVATE 0.102.2
+ __cli_strnstr@CLAMAV_PRIVATE 0.102.2
+ base64Flush@CLAMAV_PRIVATE 0.102.2
+ blobAddData@CLAMAV_PRIVATE 0.102.2
+ blobCreate@CLAMAV_PRIVATE 0.102.2
+ blobDestroy@CLAMAV_PRIVATE 0.102.2
+ cl_ASN1_GetTimeT@CLAMAV_PRIVATE 0.102.2
  cl_always_gen_section_hash@CLAMAV_PUBLIC 0.101.0
- cl_base64_decode@CLAMAV_PRIVATE 0.102.1
- cl_base64_encode@CLAMAV_PRIVATE 0.102.1
- cl_cleanup_crypto@CLAMAV_PRIVATE 0.102.1
+ cl_base64_decode@CLAMAV_PRIVATE 0.102.2
+ cl_base64_encode@CLAMAV_PRIVATE 0.102.2
+ cl_cleanup_crypto@CLAMAV_PRIVATE 0.102.2
  cl_countsigs@CLAMAV_PUBLIC 0.101.0
  cl_cvdfree@CLAMAV_PUBLIC 0.101.0
  cl_cvdhead@CLAMAV_PUBLIC 0.101.0
@@ -54,21 +54,21 @@ libclamav.so.9 libclamav9 #MINVER#
  cl_fmap_close@CLAMAV_PUBLIC 0.101.0
  cl_fmap_open_handle@CLAMAV_PUBLIC 0.101.0
  cl_fmap_open_memory@CLAMAV_PUBLIC 0.101.0
- cl_get_pkey_file@CLAMAV_PRIVATE 0.102.1
- cl_get_x509_from_mem@CLAMAV_PRIVATE 0.102.1
- cl_hash_data@CLAMAV_PRIVATE 0.102.1
+ cl_get_pkey_file@CLAMAV_PRIVATE 0.102.2
+ cl_get_x509_from_mem@CLAMAV_PRIVATE 0.102.2
+ cl_hash_data@CLAMAV_PRIVATE 0.102.2
  cl_hash_destroy@CLAMAV_PUBLIC 0.101.0
- cl_hash_file_fd@CLAMAV_PRIVATE 0.102.1
- cl_hash_file_fd_ctx@CLAMAV_PRIVATE 0.102.1
- cl_hash_file_fp@CLAMAV_PRIVATE 0.102.1
+ cl_hash_file_fd@CLAMAV_PRIVATE 0.102.2
+ cl_hash_file_fd_ctx@CLAMAV_PRIVATE 0.102.2
+ cl_hash_file_fp@CLAMAV_PRIVATE 0.102.2
  cl_hash_init@CLAMAV_PUBLIC 0.101.0
  cl_init@CLAMAV_PUBLIC 0.101.0
- cl_initialize_crypto@CLAMAV_PRIVATE 0.102.1
+ cl_initialize_crypto@CLAMAV_PRIVATE 0.102.2
  cl_load@CLAMAV_PUBLIC 0.101.0
- cl_load_cert@CLAMAV_PRIVATE 0.102.1
- cl_load_crl@CLAMAV_PRIVATE 0.102.1
+ cl_load_cert@CLAMAV_PRIVATE 0.102.2
+ cl_load_crl@CLAMAV_PRIVATE 0.102.2
  cl_retdbdir@CLAMAV_PUBLIC 0.101.0
- cl_retflevel@CLAMAV_PUBLIC 0.102.1
+ cl_retflevel@CLAMAV_PUBLIC 0.102.2
  cl_retver@CLAMAV_PUBLIC 0.101.0
  cl_scandesc@CLAMAV_PUBLIC 0.101.0
  cl_scandesc_callback@CLAMAV_PUBLIC 0.101.0
@@ -76,187 +76,188 @@ libclamav.so.9 libclamav9 #MINVER#
  cl_scanfile_callback@CLAMAV_PUBLIC 0.101.0
  cl_scanmap_callback@CLAMAV_PUBLIC 0.101.0
  cl_set_clcb_msg@CLAMAV_PUBLIC 0.101.0
- cl_sha1@CLAMAV_PRIVATE 0.102.1
- cl_sha256@CLAMAV_PRIVATE 0.102.1
- cl_sign_data@CLAMAV_PRIVATE 0.102.1
- cl_sign_data_keyfile@CLAMAV_PRIVATE 0.102.1
- cl_sign_file_fd@CLAMAV_PRIVATE 0.102.1
- cl_sign_file_fp@CLAMAV_PRIVATE 0.102.1
+ cl_sha1@CLAMAV_PRIVATE 0.102.2
+ cl_sha256@CLAMAV_PRIVATE 0.102.2
+ cl_sign_data@CLAMAV_PRIVATE 0.102.2
+ cl_sign_data_keyfile@CLAMAV_PRIVATE 0.102.2
+ cl_sign_file_fd@CLAMAV_PRIVATE 0.102.2
+ cl_sign_file_fp@CLAMAV_PRIVATE 0.102.2
  cl_statchkdir@CLAMAV_PUBLIC 0.101.0
  cl_statfree@CLAMAV_PUBLIC 0.101.0
  cl_statinidir@CLAMAV_PUBLIC 0.101.0
  cl_strerror@CLAMAV_PUBLIC 0.101.0
  cl_update_hash@CLAMAV_PUBLIC 0.101.0
- cl_validate_certificate_chain@CLAMAV_PRIVATE 0.102.1
- cl_validate_certificate_chain_ts_dir@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_fd@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_fd_x509@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_fd_x509_keyfile@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_hash@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_hash_x509@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_hash_x509_keyfile@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_x509@CLAMAV_PRIVATE 0.102.1
- cl_verify_signature_x509_keyfile@CLAMAV_PRIVATE 0.102.1
- cli_ac_buildtrie@CLAMAV_PRIVATE 0.102.1
- cli_ac_chklsig@CLAMAV_PRIVATE 0.102.1
- cli_ac_free@CLAMAV_PRIVATE 0.102.1
- cli_ac_freedata@CLAMAV_PRIVATE 0.102.1
- cli_ac_init@CLAMAV_PRIVATE 0.102.1
- cli_ac_initdata@CLAMAV_PRIVATE 0.102.1
- cli_ac_scanbuff@CLAMAV_PRIVATE 0.102.1
- cli_bm_free@CLAMAV_PRIVATE 0.102.1
- cli_bm_init@CLAMAV_PRIVATE 0.102.1
- cli_bm_scanbuff@CLAMAV_PRIVATE 0.102.1
- cli_build_regex_list@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_alloc@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_clear@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_destroy@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_getresult_int@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_set_trace@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_setfile@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_setfuncid@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_setparam_int@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_context_setparam_ptr@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_debug@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_debug_printsrc@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_describe@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_destroy@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_done@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_init@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_load@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_prepare2@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_printversion@CLAMAV_PRIVATE 0.102.1
- cli_bytecode_run@CLAMAV_PRIVATE 0.102.1
- cli_bytefunc_describe@CLAMAV_PRIVATE 0.102.1
- cli_byteinst_describe@CLAMAV_PRIVATE 0.102.1
- cli_bytetype_describe@CLAMAV_PRIVATE 0.102.1
- cli_bytevalue_describe@CLAMAV_PRIVATE 0.102.1
- cli_calloc@CLAMAV_PRIVATE 0.102.1
- cli_check_auth_header@CLAMAV_PRIVATE 0.102.1
- cli_chomp@CLAMAV_PRIVATE 0.102.1
- cli_ctime@CLAMAV_PRIVATE 0.102.1
- cli_cvdunpack@CLAMAV_PRIVATE 0.102.1
- cli_dbgmsg_internal@CLAMAV_PRIVATE 0.102.1
- cli_dconf_init@CLAMAV_PRIVATE 0.102.1
- cli_debug_flag@CLAMAV_PRIVATE 0.102.1
- cli_detect_environment@CLAMAV_PRIVATE 0.102.1
- cli_disasm_one@CLAMAV_PRIVATE 0.102.1
- cli_errmsg@CLAMAV_PRIVATE 0.102.1
- cli_filecopy@CLAMAV_PRIVATE 0.102.1
- cli_fmap_scandesc@CLAMAV_PRIVATE 0.102.1
- cli_free_vba_project@CLAMAV_PRIVATE 0.102.1
- cli_ftw@CLAMAV_PRIVATE 0.102.1
- cli_genhash_pe@CLAMAV_PRIVATE 0.102.1
- cli_gentemp@CLAMAV_PRIVATE 0.102.1
- cli_gentempfd@CLAMAV_PRIVATE 0.102.1
- cli_gettmpdir@CLAMAV_PRIVATE 0.102.1
- cli_hashfile@CLAMAV_PRIVATE 0.102.1
- cli_hashset_destroy@CLAMAV_PRIVATE 0.102.1
- cli_hashstream@CLAMAV_PRIVATE 0.102.1
- cli_hex2str@CLAMAV_PRIVATE 0.102.1
- cli_hex2ui@CLAMAV_PRIVATE 0.102.1
- cli_initroots@CLAMAV_PRIVATE 0.102.1
- cli_isnumber@CLAMAV_PRIVATE 0.102.1
- cli_js_destroy@CLAMAV_PRIVATE 0.102.1
- cli_js_init@CLAMAV_PRIVATE 0.102.1
- cli_js_output@CLAMAV_PRIVATE 0.102.1
- cli_js_parse_done@CLAMAV_PRIVATE 0.102.1
- cli_js_process_buffer@CLAMAV_PRIVATE 0.102.1
- cli_ldbtokenize@CLAMAV_PRIVATE 0.102.1
- cli_malloc@CLAMAV_PRIVATE 0.102.1
- cli_memstr@CLAMAV_PRIVATE 0.102.1
- cli_ole2_extract@CLAMAV_PRIVATE 0.102.1
- cli_parse_add@CLAMAV_PRIVATE 0.102.1
- cli_pcre_build@CLAMAV_PRIVATE 0.102.1
- cli_pcre_freeoff@CLAMAV_PRIVATE 0.102.1
- cli_pcre_init@CLAMAV_PRIVATE 0.102.1
- cli_pcre_perf_events_destroy@CLAMAV_PRIVATE 0.102.1
- cli_pcre_perf_print@CLAMAV_PRIVATE 0.102.1
- cli_pcre_recaloff@CLAMAV_PRIVATE 0.102.1
- cli_pcre_scanbuf@CLAMAV_PRIVATE 0.102.1
- cli_ppt_vba_read@CLAMAV_PRIVATE 0.102.1
- cli_printcxxver@CLAMAV_PRIVATE 0.102.1
- cli_readn@CLAMAV_PRIVATE 0.102.1
- cli_realloc@CLAMAV_PRIVATE 0.102.1
- cli_regcomp@CLAMAV_PRIVATE 0.102.1
- cli_regex2suffix@CLAMAV_PRIVATE 0.102.1
- cli_regexec@CLAMAV_PRIVATE 0.102.1
- cli_regfree@CLAMAV_PRIVATE 0.102.1
- cli_rmdirs@CLAMAV_PRIVATE 0.102.1
- cli_rndnum@CLAMAV_PRIVATE 0.102.1
- cli_sanitize_filepath@CLAMAV_PRIVATE 0.102.1
- cli_scanbuff@CLAMAV_PRIVATE 0.102.1
- cli_sigopts_handler@CLAMAV_PRIVATE 0.102.1
- cli_sigperf_events_destroy@CLAMAV_PRIVATE 0.102.1
- cli_sigperf_print@CLAMAV_PRIVATE 0.102.1
- cli_str2hex@CLAMAV_PRIVATE 0.102.1
- cli_strbcasestr@CLAMAV_PRIVATE 0.102.1
- cli_strdup@CLAMAV_PRIVATE 0.102.1
- cli_strerror@CLAMAV_PRIVATE 0.102.1
- cli_strlcat@CLAMAV_PRIVATE 0.102.1
- cli_strlcpy@CLAMAV_PRIVATE 0.102.1
- cli_strrcpy@CLAMAV_PRIVATE 0.102.1
- cli_strtok@CLAMAV_PRIVATE 0.102.1
- cli_strtokbuf@CLAMAV_PRIVATE 0.102.1
- cli_strtokenize@CLAMAV_PRIVATE 0.102.1
- cli_textbuffer_append_normalize@CLAMAV_PRIVATE 0.102.1
- cli_unescape@CLAMAV_PRIVATE 0.102.1
- cli_unlink@CLAMAV_PRIVATE 0.102.1
- cli_url_canon@CLAMAV_PRIVATE 0.102.1
- cli_utf16_to_utf8@CLAMAV_PRIVATE 0.102.1
- cli_utf16toascii@CLAMAV_PRIVATE 0.102.1
- cli_vba_inflate@CLAMAV_PRIVATE 0.102.1
- cli_vba_readdir@CLAMAV_PRIVATE 0.102.1
- cli_versig2@CLAMAV_PRIVATE 0.102.1
- cli_versig@CLAMAV_PRIVATE 0.102.1
- cli_warnmsg@CLAMAV_PRIVATE 0.102.1
- cli_wm_decrypt_macro@CLAMAV_PRIVATE 0.102.1
- cli_wm_readdir@CLAMAV_PRIVATE 0.102.1
- cli_writen@CLAMAV_PRIVATE 0.102.1
- decodeLine@CLAMAV_PRIVATE 0.102.1
- disasmbuf@CLAMAV_PRIVATE 0.102.1
- fmap@CLAMAV_PRIVATE 0.102.1
- get_fpu_endian@CLAMAV_PRIVATE 0.102.1
- have_clamjit@CLAMAV_PRIVATE 0.102.1
- have_rar@CLAMAV_PRIVATE 0.102.1
- html_normalise_map@CLAMAV_PRIVATE 0.102.1
- html_normalise_mem@CLAMAV_PRIVATE 0.102.1
- html_screnc_decode@CLAMAV_PRIVATE 0.102.1
- html_tag_arg_free@CLAMAV_PRIVATE 0.102.1
- init_domainlist@CLAMAV_PRIVATE 0.102.1
- init_regex_list@CLAMAV_PRIVATE 0.102.1
- init_whitelist@CLAMAV_PRIVATE 0.102.1
- is_regex_ok@CLAMAV_PRIVATE 0.102.1
- load_regex_matcher@CLAMAV_PRIVATE 0.102.1
+ cl_validate_certificate_chain@CLAMAV_PRIVATE 0.102.2
+ cl_validate_certificate_chain_ts_dir@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_fd@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_fd_x509@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_fd_x509_keyfile@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_hash@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_hash_x509@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_hash_x509_keyfile@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_x509@CLAMAV_PRIVATE 0.102.2
+ cl_verify_signature_x509_keyfile@CLAMAV_PRIVATE 0.102.2
+ cli_ac_buildtrie@CLAMAV_PRIVATE 0.102.2
+ cli_ac_chklsig@CLAMAV_PRIVATE 0.102.2
+ cli_ac_free@CLAMAV_PRIVATE 0.102.2
+ cli_ac_freedata@CLAMAV_PRIVATE 0.102.2
+ cli_ac_init@CLAMAV_PRIVATE 0.102.2
+ cli_ac_initdata@CLAMAV_PRIVATE 0.102.2
+ cli_ac_scanbuff@CLAMAV_PRIVATE 0.102.2
+ cli_bm_free@CLAMAV_PRIVATE 0.102.2
+ cli_bm_init@CLAMAV_PRIVATE 0.102.2
+ cli_bm_scanbuff@CLAMAV_PRIVATE 0.102.2
+ cli_build_regex_list@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_alloc@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_clear@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_destroy@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_getresult_int@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_set_trace@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_setfile@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_setfuncid@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_setparam_int@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_context_setparam_ptr@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_debug@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_debug_printsrc@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_describe@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_destroy@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_done@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_init@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_load@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_prepare2@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_printversion@CLAMAV_PRIVATE 0.102.2
+ cli_bytecode_run@CLAMAV_PRIVATE 0.102.2
+ cli_bytefunc_describe@CLAMAV_PRIVATE 0.102.2
+ cli_byteinst_describe@CLAMAV_PRIVATE 0.102.2
+ cli_bytetype_describe@CLAMAV_PRIVATE 0.102.2
+ cli_bytevalue_describe@CLAMAV_PRIVATE 0.102.2
+ cli_calloc@CLAMAV_PRIVATE 0.102.2
+ cli_check_auth_header@CLAMAV_PRIVATE 0.102.2
+ cli_chomp@CLAMAV_PRIVATE 0.102.2
+ cli_ctime@CLAMAV_PRIVATE 0.102.2
+ cli_cvdunpack@CLAMAV_PRIVATE 0.102.2
+ cli_dbgmsg_internal@CLAMAV_PRIVATE 0.102.2
+ cli_dconf_init@CLAMAV_PRIVATE 0.102.2
+ cli_debug_flag@CLAMAV_PRIVATE 0.102.2
+ cli_detect_environment@CLAMAV_PRIVATE 0.102.2
+ cli_disasm_one@CLAMAV_PRIVATE 0.102.2
+ cli_errmsg@CLAMAV_PRIVATE 0.102.2
+ cli_filecopy@CLAMAV_PRIVATE 0.102.2
+ cli_fmap_scandesc@CLAMAV_PRIVATE 0.102.2
+ cli_free_vba_project@CLAMAV_PRIVATE 0.102.2
+ cli_ftw@CLAMAV_PRIVATE 0.102.2
+ cli_genhash_pe@CLAMAV_PRIVATE 0.102.2
+ cli_gentemp@CLAMAV_PRIVATE 0.102.2
+ cli_gentemp_with_prefix@CLAMAV_PRIVATE 0.102.2
+ cli_gentempfd@CLAMAV_PRIVATE 0.102.2
+ cli_gettmpdir@CLAMAV_PRIVATE 0.102.2
+ cli_hashfile@CLAMAV_PRIVATE 0.102.2
+ cli_hashset_destroy@CLAMAV_PRIVATE 0.102.2
+ cli_hashstream@CLAMAV_PRIVATE 0.102.2
+ cli_hex2str@CLAMAV_PRIVATE 0.102.2
+ cli_hex2ui@CLAMAV_PRIVATE 0.102.2
+ cli_initroots@CLAMAV_PRIVATE 0.102.2
+ cli_isnumber@CLAMAV_PRIVATE 0.102.2
+ cli_js_destroy@CLAMAV_PRIVATE 0.102.2
+ cli_js_init@CLAMAV_PRIVATE 0.102.2
+ cli_js_output@CLAMAV_PRIVATE 0.102.2
+ cli_js_parse_done@CLAMAV_PRIVATE 0.102.2
+ cli_js_process_buffer@CLAMAV_PRIVATE 0.102.2
+ cli_ldbtokenize@CLAMAV_PRIVATE 0.102.2
+ cli_malloc@CLAMAV_PRIVATE 0.102.2
+ cli_memstr@CLAMAV_PRIVATE 0.102.2
+ cli_ole2_extract@CLAMAV_PRIVATE 0.102.2
+ cli_parse_add@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_build@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_freeoff@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_init@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_perf_events_destroy@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_perf_print@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_recaloff@CLAMAV_PRIVATE 0.102.2
+ cli_pcre_scanbuf@CLAMAV_PRIVATE 0.102.2
+ cli_ppt_vba_read@CLAMAV_PRIVATE 0.102.2
+ cli_printcxxver@CLAMAV_PRIVATE 0.102.2
+ cli_readn@CLAMAV_PRIVATE 0.102.2
+ cli_realloc@CLAMAV_PRIVATE 0.102.2
+ cli_regcomp@CLAMAV_PRIVATE 0.102.2
+ cli_regex2suffix@CLAMAV_PRIVATE 0.102.2
+ cli_regexec@CLAMAV_PRIVATE 0.102.2
+ cli_regfree@CLAMAV_PRIVATE 0.102.2
+ cli_rmdirs@CLAMAV_PRIVATE 0.102.2
+ cli_rndnum@CLAMAV_PRIVATE 0.102.2
+ cli_sanitize_filepath@CLAMAV_PRIVATE 0.102.2
+ cli_scanbuff@CLAMAV_PRIVATE 0.102.2
+ cli_sigopts_handler@CLAMAV_PRIVATE 0.102.2
+ cli_sigperf_events_destroy@CLAMAV_PRIVATE 0.102.2
+ cli_sigperf_print@CLAMAV_PRIVATE 0.102.2
+ cli_str2hex@CLAMAV_PRIVATE 0.102.2
+ cli_strbcasestr@CLAMAV_PRIVATE 0.102.2
+ cli_strdup@CLAMAV_PRIVATE 0.102.2
+ cli_strerror@CLAMAV_PRIVATE 0.102.2
+ cli_strlcat@CLAMAV_PRIVATE 0.102.2
+ cli_strlcpy@CLAMAV_PRIVATE 0.102.2
+ cli_strrcpy@CLAMAV_PRIVATE 0.102.2
+ cli_strtok@CLAMAV_PRIVATE 0.102.2
+ cli_strtokbuf@CLAMAV_PRIVATE 0.102.2
+ cli_strtokenize@CLAMAV_PRIVATE 0.102.2
+ cli_textbuffer_append_normalize@CLAMAV_PRIVATE 0.102.2
+ cli_unescape@CLAMAV_PRIVATE 0.102.2
+ cli_unlink@CLAMAV_PRIVATE 0.102.2
+ cli_url_canon@CLAMAV_PRIVATE 0.102.2
+ cli_utf16_to_utf8@CLAMAV_PRIVATE 0.102.2
+ cli_utf16toascii@CLAMAV_PRIVATE 0.102.2
+ cli_vba_inflate@CLAMAV_PRIVATE 0.102.2
+ cli_vba_readdir@CLAMAV_PRIVATE 0.102.2
+ cli_versig2@CLAMAV_PRIVATE 0.102.2
+ cli_versig@CLAMAV_PRIVATE 0.102.2
+ cli_warnmsg@CLAMAV_PRIVATE 0.102.2
+ cli_wm_decrypt_macro@CLAMAV_PRIVATE 0.102.2
+ cli_wm_readdir@CLAMAV_PRIVATE 0.102.2
+ cli_writen@CLAMAV_PRIVATE 0.102.2
+ decodeLine@CLAMAV_PRIVATE 0.102.2
+ disasmbuf@CLAMAV_PRIVATE 0.102.2
+ fmap@CLAMAV_PRIVATE 0.102.2
+ get_fpu_endian@CLAMAV_PRIVATE 0.102.2
+ have_clamjit@CLAMAV_PRIVATE 0.102.2
+ have_rar@CLAMAV_PRIVATE 0.102.2
+ html_normalise_map@CLAMAV_PRIVATE 0.102.2
+ html_normalise_mem@CLAMAV_PRIVATE 0.102.2
+ html_screnc_decode@CLAMAV_PRIVATE 0.102.2
+ html_tag_arg_free@CLAMAV_PRIVATE 0.102.2
+ init_domainlist@CLAMAV_PRIVATE 0.102.2
+ init_regex_list@CLAMAV_PRIVATE 0.102.2
+ init_whitelist@CLAMAV_PRIVATE 0.102.2
+ is_regex_ok@CLAMAV_PRIVATE 0.102.2
+ load_regex_matcher@CLAMAV_PRIVATE 0.102.2
  lsig_sub_matched@CLAMAV_PUBLIC 0.101.0
- messageCreate@CLAMAV_PRIVATE 0.102.1
- messageDestroy@CLAMAV_PRIVATE 0.102.1
- mpool_calloc@CLAMAV_PRIVATE 0.102.1
- mpool_create@CLAMAV_PRIVATE 0.102.1
- mpool_destroy@CLAMAV_PRIVATE 0.102.1
- mpool_free@CLAMAV_PRIVATE 0.102.1
- mpool_getstats@CLAMAV_PRIVATE 0.102.1
- phishingScan@CLAMAV_PRIVATE 0.102.1
- phishing_done@CLAMAV_PRIVATE 0.102.1
- phishing_init@CLAMAV_PRIVATE 0.102.1
- regex_list_add_pattern@CLAMAV_PRIVATE 0.102.1
- regex_list_done@CLAMAV_PRIVATE 0.102.1
- regex_list_match@CLAMAV_PRIVATE 0.102.1
- tableCreate@CLAMAV_PRIVATE 0.102.1
- tableDestroy@CLAMAV_PRIVATE 0.102.1
- tableFind@CLAMAV_PRIVATE 0.102.1
- tableInsert@CLAMAV_PRIVATE 0.102.1
- tableIterate@CLAMAV_PRIVATE 0.102.1
- tableRemove@CLAMAV_PRIVATE 0.102.1
- tableUpdate@CLAMAV_PRIVATE 0.102.1
- text_normalize_init@CLAMAV_PRIVATE 0.102.1
- text_normalize_map@CLAMAV_PRIVATE 0.102.1
- text_normalize_reset@CLAMAV_PRIVATE 0.102.1
- uniq_add@CLAMAV_PRIVATE 0.102.1
- uniq_free@CLAMAV_PRIVATE 0.102.1
- uniq_get@CLAMAV_PRIVATE 0.102.1
- uniq_init@CLAMAV_PRIVATE 0.102.1
+ messageCreate@CLAMAV_PRIVATE 0.102.2
+ messageDestroy@CLAMAV_PRIVATE 0.102.2
+ mpool_calloc@CLAMAV_PRIVATE 0.102.2
+ mpool_create@CLAMAV_PRIVATE 0.102.2
+ mpool_destroy@CLAMAV_PRIVATE 0.102.2
+ mpool_free@CLAMAV_PRIVATE 0.102.2
+ mpool_getstats@CLAMAV_PRIVATE 0.102.2
+ phishingScan@CLAMAV_PRIVATE 0.102.2
+ phishing_done@CLAMAV_PRIVATE 0.102.2
+ phishing_init@CLAMAV_PRIVATE 0.102.2
+ regex_list_add_pattern@CLAMAV_PRIVATE 0.102.2
+ regex_list_done@CLAMAV_PRIVATE 0.102.2
+ regex_list_match@CLAMAV_PRIVATE 0.102.2
+ tableCreate@CLAMAV_PRIVATE 0.102.2
+ tableDestroy@CLAMAV_PRIVATE 0.102.2
+ tableFind@CLAMAV_PRIVATE 0.102.2
+ tableInsert@CLAMAV_PRIVATE 0.102.2
+ tableIterate@CLAMAV_PRIVATE 0.102.2
+ tableRemove@CLAMAV_PRIVATE 0.102.2
+ tableUpdate@CLAMAV_PRIVATE 0.102.2
+ text_normalize_init@CLAMAV_PRIVATE 0.102.2
+ text_normalize_map@CLAMAV_PRIVATE 0.102.2
+ text_normalize_reset@CLAMAV_PRIVATE 0.102.2
+ uniq_add@CLAMAV_PRIVATE 0.102.2
+ uniq_free@CLAMAV_PRIVATE 0.102.2
+ uniq_get@CLAMAV_PRIVATE 0.102.2
+ uniq_init@CLAMAV_PRIVATE 0.102.2
 libfreshclam.so.2 libclamav9 #MINVER#
  FRESHCLAM_PRIVATE@FRESHCLAM_PRIVATE 0.102.1
  FRESHCLAM_PUBLIC@FRESHCLAM_PUBLIC 0.102.1
diff --git a/debian/patches/add-support-for-system-tomsfastmath.patch b/debian/patches/add-support-for-system-tomsfastmath.patch
index c002c37..25b78ff 100644
--- a/debian/patches/add-support-for-system-tomsfastmath.patch
+++ b/debian/patches/add-support-for-system-tomsfastmath.patch
@@ -59,7 +59,7 @@ index e178d4b..88a0e60 100644
 +libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
 +endif
  
- .PHONY: version.h.tmp
+ .PHONY2: version.h.tmp
  version.c: version.h
 diff --git a/libclamav/bignum.h b/libclamav/bignum.h
 index 8fdc956..56dfa95 100644
diff --git a/debian/patches/clamsubmit-libfreshclam-Use-CURL_CA_BUNDLE.patch b/debian/patches/clamsubmit-libfreshclam-Use-CURL_CA_BUNDLE.patch
new file mode 100644
index 0000000..dd37616
--- /dev/null
+++ b/debian/patches/clamsubmit-libfreshclam-Use-CURL_CA_BUNDLE.patch
@@ -0,0 +1,90 @@
+From 2d34217d30a97a3e191186f82a85cb99e8e50af8 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: Sun, 16 Feb 2020 17:09:37 +0100
+Subject: clamsubmit / libfreshclam: Use CURL_CA_BUNDLE
+
+Use the CURL_CA_BUNDLE enviroment to set cURL's CURLOPT_CAINFO option.
+This is also used by the command line tool.
+
+Patch-Name: clamsubmit-libfreshclam-Use-CURL_CA_BUNDLE.patch
+Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+---
+ clamsubmit/clamsubmit.c              | 15 +++++++++++++++
+ libfreshclam/libfreshclam_internal.c | 13 +++++++++++++
+ 2 files changed, 28 insertions(+)
+
+diff --git a/clamsubmit/clamsubmit.c b/clamsubmit/clamsubmit.c
+index c3edfff..13b81e3 100644
+--- a/clamsubmit/clamsubmit.c
++++ b/clamsubmit/clamsubmit.c
+@@ -1,3 +1,4 @@
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #if HAVE_UNISTD_H
+@@ -145,6 +146,18 @@ const char *presigned_get_string(json_object *ps_json_obj, char *key)
+     return json_str;
+ }
+ 
++static void set_tls_ca_bundle(CURL *curl)
++{
++	char *ca_bundle;
++
++	ca_bundle = secure_getenv("CURL_CA_BUNDLE");
++	if (!ca_bundle)
++		return;
++
++	if (curl_easy_setopt(curl, CURLOPT_CAINFO, ca_bundle) != CURLE_OK)
++		fprintf(stderr, "Failed to set CURLOPT_CAINFO!\n");
++}
++
+ int main(int argc, char *argv[])
+ {
+     int status = 1;
+@@ -186,6 +199,7 @@ int main(int argc, char *argv[])
+     if (CURLE_OK != curl_easy_setopt(clam_curl, CURLOPT_USERAGENT, userAgent)) {
+         fprintf(stderr, "!create_curl_handle: Failed to set CURLOPT_USERAGENT (%s)!\n", userAgent);
+     }
++    set_tls_ca_bundle(clam_curl);
+ 
+     while ((ch = my_getopt(argc, argv, OPTS)) > 0) {
+         switch (ch) {
+@@ -398,6 +412,7 @@ int main(int argc, char *argv[])
+     if (CURLE_OK != curl_easy_setopt(aws_curl, CURLOPT_USERAGENT, userAgent)) {
+         fprintf(stderr, "!create_curl_handle: Failed to set CURLOPT_USERAGENT (%s)!\n", userAgent);
+     }
++    set_tls_ca_bundle(aws_curl);
+ 
+     if (g_debug) {
+         /* ask libcurl to show us the verbose output */
+diff --git a/libfreshclam/libfreshclam_internal.c b/libfreshclam/libfreshclam_internal.c
+index 9907254..26cd052 100644
+--- a/libfreshclam/libfreshclam_internal.c
++++ b/libfreshclam/libfreshclam_internal.c
+@@ -260,6 +260,18 @@ static int xferinfo(void *prog,
+     return 0;
+ }
+ 
++static void set_tls_ca_bundle(CURL *curl)
++{
++    char *ca_bundle;
++
++    ca_bundle = secure_getenv("CURL_CA_BUNDLE");
++    if (!ca_bundle)
++	    return;
++
++    if (curl_easy_setopt(curl, CURLOPT_CAINFO, ca_bundle) != CURLE_OK)
++	    logg("!set_tls_ca_bundle: Failed to set CURLOPT_CAINFO!\n");
++}
++
+ #if LIBCURL_VERSION_NUM < 0x072000
+ /**
+  * Function from curl example code, Copyright (C) 1998 - 2018, Daniel Stenberg, see COPYING.curl for license details
+@@ -345,6 +357,7 @@ static fc_error_t create_curl_handle(
+             }
+         }
+     }
++    set_tls_ca_bundle(curl);
+ 
+ #if (LIBCURL_VERSION_MAJOR > 7) || ((LIBCURL_VERSION_MAJOR == 7) && (LIBCURL_VERSION_MINOR >= 33))
+     if (g_localIP) {
diff --git a/debian/patches/series b/debian/patches/series
index 28004d0..4858954 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ clamd_dont_depend_on_clamav_demon_socket.patch
 Add-support-for-LLVM-3.7.patch
 Add-support-for-LLVM-3.8.patch
 Add-support-for-LLVM-3.9.patch
+clamsubmit-libfreshclam-Use-CURL_CA_BUNDLE.patch
diff --git a/debian/rules b/debian/rules
index 7c67f1d..1bac645 100755
--- a/debian/rules
+++ b/debian/rules
@@ -88,7 +88,7 @@ endif
 	  fi;\
 	done; \
 	# Check for library features which may have been upgraded.
-	if ! grep -q "CL_FLEVEL 112" libclamav/others.h ; then \
+	if ! grep -q "CL_FLEVEL 113" libclamav/others.h ; then \
 		echo "cl_retflevel needs boosting in symbol file"; \
 		touch debian/exit; \
 	fi;
diff --git a/docs/html/UserManual/Installation-Unix.html b/docs/html/UserManual/Installation-Unix.html
index 516bf61..7dc640c 100644
--- a/docs/html/UserManual/Installation-Unix.html
+++ b/docs/html/UserManual/Installation-Unix.html
@@ -90,7 +90,7 @@
 <p>These are instructions specific to some popular operating systems:</p>
 <ul>
 <li><a href="../UserManual/Installation-Unix/Steps-Debian-Ubuntu.html#Users-and-on-user-privileges">Debian, Ubuntu, etc</a></li>
-<li><a href="../UserManual/Installation-Unix/Steps-Debian-Ubuntu.html#Users-and-on-user-privileges">Redhat, CentOS, etc</a></li>
+<li><a href="../UserManual/Installation-Unix/Steps-Redhat-CentOS.html">Redhat, CentOS, etc</a></li>
 <li><a href="../UserManual/Installation-Unix/Steps-macOS.html#Users-and-on-user-privileges">macOS</a></li>
 </ul>
 <p>If your operating system isn't specified above, and your OS does not have the <code>groupadd</code> and <code>useradd</code> utilities, consult a system manual. <strong>Don’t forget to lock access to the account!</strong></p>
@@ -123,7 +123,7 @@
 <p>For additional recommendations, please read:</p>
 <ul>
 <li><a href="../UserManual/Installation-Unix/Steps-Debian-Ubuntu.html#First-time-set-up">Debian, Ubuntu, etc</a></li>
-<li><a href="../UserManual/Installation-Unix/Steps-Debian-Ubuntu.html#First-time-set-up">Redhat, CentOS, etc</a></li>
+<li><a href="../UserManual/Installation-Unix/Steps-Redhat-CentOS.html">Redhat, CentOS, etc</a></li>
 <li><a href="../UserManual/Installation-Unix/Steps-macOS.html#First-time-set-up">macOS</a></li>
 </ul>
 <hr />
diff --git a/docs/html/UserManual/Installation-Unix/Steps-Debian-Ubuntu.html b/docs/html/UserManual/Installation-Unix/Steps-Debian-Ubuntu.html
index 6b24fdf..9f376be 100644
--- a/docs/html/UserManual/Installation-Unix/Steps-Debian-Ubuntu.html
+++ b/docs/html/UserManual/Installation-Unix/Steps-Debian-Ubuntu.html
@@ -31,7 +31,7 @@ sudo apt-get install libmilter1.0.1 libmilter-dev<br />
 </ol></li>
 <li>Install the unit testing dependencies<br />
 <pre><br />
-sudo apt-get install valgrind check<br />
+sudo apt-get install valgrind check check-devel<br />
 </pre></li>
 </ol>
 <p><em>Note</em>: LLVM is also an optional dependency. LLVM will not provide any additional features, but is an alternative method for executing bytecode signatures versus using the built-in bytecode interpreter. Limited performance testing between LLVM and the bytecode interpreter did not yield conclusive evidence that one is &quot;better&quot; than the other. For the sake of simplicity, it is not recommended to install LLVM.</p>
@@ -46,7 +46,7 @@ sudo apt-get install valgrind check<br />
 <pre>
     cd ~/Downloads
     tar xzf clamav-[ver].tar.gz
-    cd clamav-[ver].tar.gz
+    cd clamav-[ver]
 </pre>
 <hr />
 <h2 id="configure-the-build">Configure the build</h2>
diff --git a/docs/html/UserManual/Installation-Unix/Steps-Redhat-CentOS.html b/docs/html/UserManual/Installation-Unix/Steps-Redhat-CentOS.html
index a58128b..e780b30 100644
--- a/docs/html/UserManual/Installation-Unix/Steps-Redhat-CentOS.html
+++ b/docs/html/UserManual/Installation-Unix/Steps-Redhat-CentOS.html
@@ -38,7 +38,7 @@ sudo yum repolist<br />
 </pre></p></li>
 <li><p>Install the unit testing dependencies<br />
 <pre><br />
-sudo yum install valgrind check-devel<br />
+sudo yum install valgrind check check-devel<br />
 </pre></p></li>
 </ol>
 <p><em>Note</em>: LLVM is also an optional dependency. LLVM will not provide any additional features, but is an alternative method for executing bytecode signatures versus using the built-in bytecode interpreter. Limited performance testing between LLVM and the bytecode interpreter did not yield conclusive evidence that one is &quot;better&quot; than the other. For the sake of simplicity, it is not recommended to install LLVM.</p>
@@ -53,7 +53,7 @@ sudo yum install valgrind check-devel<br />
 <pre>
     cd ~/Downloads
     tar xzf clamav-[ver].tar.gz
-    cd clamav-[ver].tar.gz
+    cd clamav-[ver]
 </pre>
 <hr />
 <h2 id="configure-the-build">Configure the build</h2>
diff --git a/docs/html/UserManual/Installation-Unix/Steps-macOS.html b/docs/html/UserManual/Installation-Unix/Steps-macOS.html
index 5be15bd..0fcb5bd 100644
--- a/docs/html/UserManual/Installation-Unix/Steps-macOS.html
+++ b/docs/html/UserManual/Installation-Unix/Steps-macOS.html
@@ -32,7 +32,7 @@ brew install openssl zlib pcre2 json-c<br />
 </ol></li>
 <li><p>Install the unit testing dependencies<br />
 <pre><br />
-brew install valgrind check<br />
+brew install valgrind check check-devel<br />
 </pre></p>
 <p><em>Tip</em>: Valgrind may not be available in Homebrew for the latest version of macOS.</p></li>
 </ol>
@@ -48,7 +48,7 @@ brew install valgrind check<br />
 <pre>
     cd ~/Downloads
     tar xzf clamav-[ver].tar.gz
-    cd clamav-[ver].tar.gz
+    cd clamav-[ver]
 </pre>
 <hr />
 <h2 id="configure-the-build">Configure the build</h2>
diff --git a/docs/html/UserManual/Installation-Windows.html b/docs/html/UserManual/Installation-Windows.html
index ea49b76..a9ea974 100644
--- a/docs/html/UserManual/Installation-Windows.html
+++ b/docs/html/UserManual/Installation-Windows.html
@@ -15,9 +15,9 @@
 <h2 id="install-using-the-clamav-windows-installer">Install using the ClamAV Windows Installer</h2>
 <p>Important: Installing ClamAV using the Installer will require Administrator privileges.</p>
 <ol>
-<li>Download: <a href="http://www.clamav.net/downloads/production/ClamAV-0.102.0.exe"; class="uri">http://www.clamav.net/downloads/production/ClamAV-0.102.0.exe</a></li>
+<li>Download: <a href="http://www.clamav.net/downloads/production/ClamAV-0.102.1.exe"; class="uri">http://www.clamav.net/downloads/production/ClamAV-0.102.1.exe</a></li>
 <li>Locate the file in your Downloads directory.</li>
-<li>Right-click on <code>ClamAV-0.102.0.exe</code> and select <code>Run as administrator</code>. You may receive a warning message along the lines of &quot;Windows protected your PC&quot;. Select <code>More info</code> and then select <code>Run anyway</code>.</li>
+<li>Right-click on <code>ClamAV-0.102.1.exe</code> and select <code>Run as administrator</code>. You may receive a warning message along the lines of &quot;Windows protected your PC&quot;. Select <code>More info</code> and then select <code>Run anyway</code>.</li>
 <li>Select <code>I accept the agreement</code> and click <code>Next</code>.</li>
 <li>Click <code>Next</code> again. If you've removed a previous installation of ClamAV, you may receive the prompt &quot;The folder ... already exists...&quot;. If you do, select <code>Yes</code>.</li>
 <li>Click <code>Install</code>.</li>
@@ -36,9 +36,9 @@ cd &quot;c:\program files\clamav&quot;<br />
 <hr />
 <h2 id="install-using-the-clamav-portable-install-package">Install using the ClamAV Portable Install Package</h2>
 <ol>
-<li>Download: <a href="https://www.clamav.net/downloads/production/clamav-0.102.0-win-x64-portable.zip"; class="uri">https://www.clamav.net/downloads/production/clamav-0.102.0-win-x64-portable.zip</a></li>
+<li>Download: <a href="https://www.clamav.net/downloads/production/clamav-0.102.1-win-x64-portable.zip"; class="uri">https://www.clamav.net/downloads/production/clamav-0.102.1-win-x64-portable.zip</a></li>
 <li>Unzip it.</li>
-<li>Open the <code>clamav-0.102.0-win-x64-portable</code> directory.</li>
+<li>Open the <code>clamav-0.102.1-win-x64-portable</code> directory.</li>
 <li>Hold down Shift and then right-click on the background in the current directory (but not on one of the files). Select <code>&quot;Open PowerShell window here&quot;</code>. If that option doesn't appear, try again.</li>
 </ol>
 <p>Continue on to &quot;First Time Set-Up&quot;...</p>
diff --git a/docs/html/UserManual/Signatures/FunctionalityLevels.html b/docs/html/UserManual/Signatures/FunctionalityLevels.html
index 978481c..2a01d51 100644
--- a/docs/html/UserManual/Signatures/FunctionalityLevels.html
+++ b/docs/html/UserManual/Signatures/FunctionalityLevels.html
@@ -14,132 +14,30 @@
 <p>Setting appropriate FLEVELs in signatures is particularly crucial when using features added in the last 3-4 major release versions.</p>
 <hr />
 <h2 id="clamav-version-to-flevel-chart">ClamAV Version to FLEVEL chart</h2>
-<table>
-<colgroup>
-<col width="8%" />
-<col width="9%" />
-<col width="9%" />
-<col width="71%" />
-</colgroup>
-<thead>
-<tr class="header">
-<th>flevel</th>
-<th>version</th>
-<th>release</th>
-<th>new signature features</th>
-</tr>
-</thead>
-<tbody>
-<tr class="odd">
-<td>41</td>
-<td>0.95.0</td>
-<td>3/2009</td>
-<td>Ignores use ign format (including line number).</td>
-</tr>
-<tr class="even">
-<td>51</td>
-<td>0.96.0</td>
-<td>3/2010</td>
-<td>Bytecode &amp; CDB sigs. Start using ign2.</td>
-</tr>
-<tr class="odd">
-<td>56</td>
-<td>0.96.4</td>
-<td>10/2010</td>
-<td>Min level for bytecode sigs.</td>
-</tr>
-<tr class="even">
-<td>60</td>
-<td>0.97.0</td>
-<td>2/2011</td>
-<td></td>
-</tr>
-<tr class="odd">
-<td>74</td>
-<td>0.98.0</td>
-<td>9/2013</td>
-<td>ISO9660 scanning support. All-match feature.</td>
-</tr>
-<tr class="even">
-<td></td>
-<td></td>
-<td></td>
-<td>Wild card bracket notation{} for body-based signatures.</td>
-</tr>
-<tr class="odd">
-<td></td>
-<td></td>
-<td></td>
-<td>&quot;SE&quot; offset modifier.</td>
-</tr>
-<tr class="even">
-<td></td>
-<td></td>
-<td></td>
-<td>Target types 10 - 13: (PDF, (SWF) Flash, Java, Internal).</td>
-</tr>
-<tr class="odd">
-<td>76</td>
-<td>0.98.1</td>
-<td>1/2014</td>
-<td>XZ support and ForceToDisk scan option.</td>
-</tr>
-<tr class="even">
-<td></td>
-<td></td>
-<td></td>
-<td>Libxml2, XAR, DMG, HFS+/HFSX.</td>
-</tr>
-<tr class="odd">
-<td></td>
-<td></td>
-<td></td>
-<td>FTM type 4 (in-buffer partition magic, analogous to type 0 for files).</td>
-</tr>
-<tr class="even">
-<td>79</td>
-<td>0.98.5</td>
-<td>11/2014</td>
-<td>File properties (preclass). Target type 13: for preclass feature.</td>
-</tr>
-<tr class="odd">
-<td>81</td>
-<td>0.99.0</td>
-<td>11/2015</td>
-<td>Yara and PCRE support. Target type 14: non-listed types (&quot;other&quot;).</td>
-</tr>
-<tr class="even">
-<td>82</td>
-<td>0.99.1</td>
-<td>2/2016</td>
-<td>Hangul Word Processor (HWP) type file parser.</td>
-</tr>
-<tr class="odd">
-<td>90</td>
-<td>0.100</td>
-<td>4/2018</td>
-<td>&quot;Intermediates&quot; logical sig expression option.</td>
-</tr>
-<tr class="even">
-<td></td>
-<td></td>
-<td></td>
-<td>MHTML and PostScript types.</td>
-</tr>
-<tr class="odd">
-<td></td>
-<td></td>
-<td></td>
-<td>Substring wildcard (*) fix: order matters, substrings can't overlap.</td>
-</tr>
-<tr class="even">
-<td>100</td>
-<td>0.101</td>
-<td>12/2018</td>
-<td>&quot;Byte-Compare&quot; Logical subsignature. Windows Shortcut (LNK) type.</td>
-</tr>
-</tbody>
-</table>
+<p>The following is an abridged list of FLEVELS for each version. Only major versions and FLEVELs relevant to new/changed/fixed signature features are listed.</p>
+<pre>
+| flevel | version | release | new signature features                                                 |
+|--------|---------|---------|------------------------------------------------------------------------|
+| 41     | 0.95.0  | 3/2009  | Ignores use ign format (including line number).                        |
+| 51     | 0.96.0  | 3/2010  | Bytecode & CDB sigs. Start using ign2.                                 |
+| 56     | 0.96.4  | 10/2010 | Min level for bytecode sigs.                                           |
+| 60     | 0.97.0  | 2/2011  |                                                                        |
+| 74     | 0.98.0  | 9/2013  | ISO9660 scanning support. All-match feature.                           |
+|        |         |         | Wild card bracket notation{} for body-based signatures.                |
+|        |         |         | "SE" offset modifier.                                                  |
+|        |         |         | Target types 10 - 13: (PDF, (SWF) Flash, Java, Internal).              |
+| 76     | 0.98.1  | 1/2014  | XZ support and ForceToDisk scan option.                                |
+|        |         |         | Libxml2, XAR, DMG, HFS+/HFSX.                                          |
+|        |         |         | FTM type 4 (in-buffer partition magic, analogous to type 0 for files). |
+| 79     | 0.98.5  | 11/2014 | File properties (preclass). Target type 13: for preclass feature.      |
+| 81     | 0.99.0  | 11/2015 | Yara and PCRE support. Target type 14: non-listed types ("other").     |
+| 82     | 0.99.1  | 2/2016  | Hangul Word Processor (HWP) type file parser.                          |
+| 90     | 0.100   | 4/2018  | "Intermediates" logical sig expression option.                         |
+|        |         |         | MHTML and PostScript types.                                            |
+|        |         |         | Substring wildcard (*) fix: order matters, substrings can't overlap.   |
+| 100    | 0.101   | 12/2018 | "Byte-Compare" Logical subsignature. Windows Shortcut (LNK) type.      |
+| 110    | 0.102   | 10/2019 | "Adds BC_ELF_UNPACKER, BC_MACHO_UNPACKER. CL_TYPE_EGG (egg archive).   |
+</pre>
 <p>For more inforamtion on ClamAV file type support, see the <a href="../../UserManual/Signatures/FileTypes.html">File Types Reference</a>.</p>
 </body>
 </html>
diff --git a/docs/man/freshclam.conf.5.in b/docs/man/freshclam.conf.5.in
index d9b6921..4cc1dc2 100644
--- a/docs/man/freshclam.conf.5.in
+++ b/docs/man/freshclam.conf.5.in
@@ -199,9 +199,9 @@ Timeout in seconds when connecting to database server.
 Default: 10
 .TP
 \fBReceiveTimeout NUMBER\fR
-Timeout in seconds when reading from database server.
+Timeout in seconds when reading from database server. 0 means no timeout.
 .br
-Default: 60
+Default: 0
 .TP
 \fBSafeBrowsing BOOL\fR
 This option enables support for Google Safe Browsing. When activated for the first time, freshclam will download a new database file (safebrowsing.cvd) which will be automatically loaded by clamd and clamscan during the next reload, provided that the heuristic phishing detection is turned on. This database includes information about websites that may be phishing sites or possible sources of malware. When using this option, it's mandatory to run freshclam at least every 30 minutes. Freshclam uses the ClamAV's mirror infrastructure to distribute the database and its updates but all the contents are provided under Google's terms of use. See https://support.google.com/code/answer/70015 and https://www.clamav.net/documents/safebrowsing for more information.
diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c
index 7b8119b..b638ad7 100644
--- a/freshclam/freshclam.c
+++ b/freshclam/freshclam.c
@@ -750,11 +750,8 @@ static fc_error_t initialize(struct optstruct *opts)
     cl_error_t cl_init_retcode;
     fc_config fcConfig;
     char *tempDirectory = NULL;
-    size_t tempDirectoryLen;
     const struct optstruct *logFileOpt = NULL;
 
-    STATBUF statbuf;
-
     memset(&fcConfig, 0, sizeof(fc_config));
 
     if (NULL == opts) {
@@ -862,25 +859,9 @@ static fc_error_t initialize(struct optstruct *opts)
     fcConfig.databaseDirectory = optget(opts, "DatabaseDirectory")->strarg;
 
     /* Select a path for the temp directory:  databaseDirectory/tmp */
-    tempDirectoryLen = strlen(fcConfig.databaseDirectory) + strlen(PATHSEP) + strlen("tmp") + 1; /* mdir/fname\0 */
-    tempDirectory    = (char *)cli_calloc(tempDirectoryLen, sizeof(char));
-    if (!tempDirectory) {
-        mprintf("!initialize: out of memory\n");
-        status = FC_EMEM;
-        goto done;
-    }
-    snprintf(tempDirectory, tempDirectoryLen, "%s" PATHSEP "tmp", fcConfig.databaseDirectory);
+    tempDirectory = cli_gentemp_with_prefix(fcConfig.databaseDirectory, "tmp");
     fcConfig.tempDirectory = tempDirectory;
 
-    if (LSTAT(tempDirectory, &statbuf) == -1) {
-        if (0 != mkdir(tempDirectory, 0755)) {
-            logg("!Can't create temporary directory %s\n", tempDirectory);
-            logg("Hint: The database directory must be writable for UID %d or GID %d\n", getuid(), getgid());
-            status = FC_EDBDIRACCESS;
-            goto done;
-        }
-    }
-
     /* Store the path of the temp directory so we can delete it later. */
     strncpy(g_freshclamTempDirectory, fcConfig.tempDirectory, sizeof(g_freshclamTempDirectory));
     g_freshclamTempDirectory[sizeof(g_freshclamTempDirectory) - 1] = '\0';
@@ -1411,6 +1392,8 @@ fc_error_t perform_database_update(
     uint32_t nUpdated      = 0;
     uint32_t nTotalUpdated = 0;
 
+    STATBUF statbuf;
+
     if (NULL == serverList) {
         mprintf("!perform_database_update: Invalid arguments.\n");
         goto done;
@@ -1437,6 +1420,18 @@ fc_error_t perform_database_update(
      */
     (void)fc_dns_query_update_info(dnsUpdateInfoServer, &dnsUpdateInfo, &newVersion);
 
+    /*
+     * Create a temp directory to use for the update process.
+     */
+    if (LSTAT(g_freshclamTempDirectory, &statbuf) == -1) {
+        if (0 != mkdir(g_freshclamTempDirectory, 0755)) {
+            logg("!Can't create temporary directory %s\n", g_freshclamTempDirectory);
+            logg("Hint: The database directory must be writable for UID %d or GID %d\n", getuid(), getgid());
+            status = FC_EDBDIRACCESS;
+            goto done;
+        }
+    }
+
     if ((NULL != databaseList) && (0 < nDatabases)) {
         /*
         * Download/update the desired official databases.
@@ -1497,6 +1492,12 @@ fc_error_t perform_database_update(
 
 done:
 
+    if (LSTAT(g_freshclamTempDirectory, &statbuf) != -1) {
+        /* Remove temp directory */
+        if (*g_freshclamTempDirectory) {
+            cli_rmdirs(g_freshclamTempDirectory);
+        }
+    }
     if (NULL != dnsUpdateInfo) {
         free(dnsUpdateInfo);
     }
@@ -1781,7 +1782,7 @@ int main(int argc, char **argv)
             bPrivate ? 0 : optget(opts, "ScriptedUpdates")->enabled,
             bPrune,
             optget(opts, "OnUpdateExecute")->enabled ? optget(opts, "OnUpdateExecute")->strarg : NULL,
-            optget(opts, "OnOutdatedExecute")->enabled ? optget(opts, "OnUpdateExecute")->strarg : NULL,
+            optget(opts, "OnOutdatedExecute")->enabled ? optget(opts, "OnOutdatedExecute")->strarg : NULL,
             optget(opts, "daemon")->enabled,
             optget(opts, "NotifyClamd")->active ? optget(opts, "NotifyClamd")->strarg : NULL,
             &fc_context);
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index 1ca0e48..00eb1b7 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -10,7 +10,7 @@
 
 if ENABLE_FUZZ
 
-LIB_FUZZING_ENGINE_DEPRECATED ?= standalone_fuzz_target_runner.a
+LIB_FUZZING_ENGINE_DEPRECATED ?= libstandalone_fuzz_target_runner.a
 
 AM_CPPFLAGS = \
     @SSL_CPPFLAGS@ \
@@ -63,8 +63,8 @@ fuzz_PROGRAMS = \
     clamav_dbload_WDB_fuzzer \
     clamav_dbload_YARA_fuzzer
 
-dist_standalone_fuzz_target_runner_a_SOURCES = standalone_fuzz_target_runner.cpp
-noinst_LIBRARIES = standalone_fuzz_target_runner.a
+dist_libstandalone_fuzz_target_runner_a_SOURCES = standalone_fuzz_target_runner.cpp
+noinst_LIBRARIES = libstandalone_fuzz_target_runner.a
 
 dist_clamav_scanmap_fuzzer_SOURCES = clamav_scanmap_fuzzer.cpp
 clamav_scanmap_fuzzer_LDADD = $(LIB_FUZZING_ENGINE_DEPRECATED) @SSL_LIBS@ $(top_builddir)/libclamav/libclamav.la $(top_builddir)/libclamav/libclammspack.la
diff --git a/libclamav/c++/config/ar-lib b/libclamav/c++/config/ar-lib
new file mode 100755
index 0000000..05094d3
--- /dev/null
+++ b/libclamav/c++/config/ar-lib
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv in
+	mingw)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try '$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    q*) quick=yes   ;;
+    r*) replace=yes ;;
+    s*) index=yes   ;;
+    S*)             ;; # the index is always updated implicitly
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    v*)             ;; # TODO: don't ignore the verbose modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+  yes,* | ,yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "${1#@}" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "${1#@}" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$quick$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "${1#@}"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff --git a/libclamav/c++/configure b/libclamav/c++/configure
index d6a821a..d0136d5 100755
--- a/libclamav/c++/configure
+++ b/libclamav/c++/configure
@@ -665,8 +665,6 @@ NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
 RANLIB
-ac_ct_AR
-AR
 DLLTOOL
 OBJDUMP
 LN_S
@@ -681,6 +679,8 @@ MAINT
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
 SSL_CPPFLAGS
+ac_ct_AR
+AR
 EGREP
 GREP
 CPP
@@ -5244,6 +5244,177 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar lib "link -lib"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar lib "link -lib"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+   am_cv_ar_interface=ar
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+  ;;
+esac
+
 
 if test "$cxxset" != set; then
 # don't use the default -O2 -g because -g bloats the C++ binaries too much
diff --git a/libclamav/c++/configure.ac b/libclamav/c++/configure.ac
index c6482de..0d7f47c 100644
--- a/libclamav/c++/configure.ac
+++ b/libclamav/c++/configure.ac
@@ -19,12 +19,13 @@ AC_CONFIG_AUX_DIR([config])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADER([clamavcxx-config.h])
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE([1.9 -Wall -Wportability foreign no-define color-tests tar-pax])
+AM_INIT_AUTOMAKE([1.11 subdir-objects -Wall -Wportability foreign no-define color-tests tar-pax])
 AM_SILENT_RULES([yes])
 
 cxxset=${CXXFLAGS+set}
 AC_PROG_CXX
 AC_C_BIGENDIAN
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 
 if test "$cxxset" != set; then
 # don't use the default -O2 -g because -g bloats the C++ binaries too much
diff --git a/libclamav/dlp.c b/libclamav/dlp.c
index a1929b5..4526461 100644
--- a/libclamav/dlp.c
+++ b/libclamav/dlp.c
@@ -176,6 +176,7 @@ int dlp_is_valid_cc(const unsigned char *buffer, size_t length)
     int mult   = 0;
     int sum    = 0;
     size_t i   = 0;
+    ssize_t j  = 0;
     int val    = 0;
     int digits = 0;
     char cc_digits[20];
@@ -232,9 +233,11 @@ int dlp_is_valid_cc(const unsigned char *buffer, size_t length)
     if (digits < 13 || (i < length && isdigit(buffer[i])))
         return 0;
 
+    j = (ssize_t)i;
+
     //figure out luhn digits
-    for (i = digits - 1; i >= 0; i--) {
-        val = cc_digits[i] - '0';
+    for (j = digits - 1; j >= 0; j--) {
+        val = cc_digits[j] - '0';
         if (mult) {
             if ((val *= 2) > 9) val -= 9;
         }
diff --git a/libclamav/dlp.h b/libclamav/dlp.h
index 792fb59..10159cf 100644
--- a/libclamav/dlp.h
+++ b/libclamav/dlp.h
@@ -1,7 +1,7 @@
 /*
  *  Simple library to detect and validate SSN and Credit Card numbers.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Martin Roesch <roesch@sourcefire.com>
diff --git a/libclamav/dmg.c b/libclamav/dmg.c
index b0d2f13..d7f8753 100644
--- a/libclamav/dmg.c
+++ b/libclamav/dmg.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: David Raynor <draynor@sourcefire.com>
diff --git a/libclamav/dmg.h b/libclamav/dmg.h
index ab31b99..03c4fb6 100644
--- a/libclamav/dmg.h
+++ b/libclamav/dmg.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: David Raynor <draynor@sourcefire.com>
diff --git a/libclamav/dsig.c b/libclamav/dsig.c
index e6d68a9..d2745c7 100644
--- a/libclamav/dsig.c
+++ b/libclamav/dsig.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/dsig.h b/libclamav/dsig.h
index 4354fd6..a3d6de5 100644
--- a/libclamav/dsig.h
+++ b/libclamav/dsig.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/egg.c b/libclamav/egg.c
index fdcd9cf..9bd5220 100644
--- a/libclamav/egg.c
+++ b/libclamav/egg.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2019-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  EGG is an archive format created by ESTsoft used by their ALZip
  *  archiving software.
diff --git a/libclamav/egg.h b/libclamav/egg.h
index 47dfd00..a6e0839 100644
--- a/libclamav/egg.h
+++ b/libclamav/egg.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2019-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  EGG is an archive format created by ESTsoft used by their ALZip
  *  archiving software.
diff --git a/libclamav/elf.c b/libclamav/elf.c
index 227235f..d2b0802 100644
--- a/libclamav/elf.c
+++ b/libclamav/elf.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/elf.h b/libclamav/elf.h
index 64b7b0b..840436f 100644
--- a/libclamav/elf.h
+++ b/libclamav/elf.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/encoding_aliases.h b/libclamav/encoding_aliases.h
index f7213af..5699897 100644
--- a/libclamav/encoding_aliases.h
+++ b/libclamav/encoding_aliases.h
@@ -1,7 +1,7 @@
 /*
  *  HTML Entity & Encoding normalization.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/entconv.c b/libclamav/entconv.c
index b2d098f..7be8c26 100644
--- a/libclamav/entconv.c
+++ b/libclamav/entconv.c
@@ -1,7 +1,7 @@
 /*
  *  HTML Entity & Encoding normalization.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/entconv.h b/libclamav/entconv.h
index 1277c29..3d2f7cc 100644
--- a/libclamav/entconv.h
+++ b/libclamav/entconv.h
@@ -1,7 +1,7 @@
 /*
  *  HTML Entity & Encoding normalization.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/entitylist.h b/libclamav/entitylist.h
index c7fdfa0..f209cce 100644
--- a/libclamav/entitylist.h
+++ b/libclamav/entitylist.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/events.c b/libclamav/events.c
index c22e8b6..9ff8738 100644
--- a/libclamav/events.c
+++ b/libclamav/events.c
@@ -1,7 +1,7 @@
 /*
  *  (bytecode) events
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2010-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/events.h b/libclamav/events.h
index df84b73..55373c5 100644
--- a/libclamav/events.h
+++ b/libclamav/events.h
@@ -1,7 +1,7 @@
 /*
  *  (bytecode) events
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2010-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/execs.c b/libclamav/execs.c
index 5d6a3f1..8c198b6 100644
--- a/libclamav/execs.c
+++ b/libclamav/execs.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2018-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2018-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Andrew Williams
  *
diff --git a/libclamav/execs.h b/libclamav/execs.h
index 4fd3d2c..2a7e3a7 100644
--- a/libclamav/execs.h
+++ b/libclamav/execs.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/explode.c b/libclamav/explode.c
index 78b5d56..72ec5d2 100644
--- a/libclamav/explode.c
+++ b/libclamav/explode.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/explode.h b/libclamav/explode.h
index efe92c7..5bada35 100644
--- a/libclamav/explode.h
+++ b/libclamav/explode.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/filetypes.c b/libclamav/filetypes.c
index c807385..3cd1ecd 100644
--- a/libclamav/filetypes.c
+++ b/libclamav/filetypes.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/filetypes.h b/libclamav/filetypes.h
index 509023f..3eccc0b 100644
--- a/libclamav/filetypes.h
+++ b/libclamav/filetypes.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/filetypes_int.h b/libclamav/filetypes_int.h
index 777b4d7..15671de 100644
--- a/libclamav/filetypes_int.h
+++ b/libclamav/filetypes_int.h
@@ -1,7 +1,7 @@
 /*
  *  Static filetype data for use when daily.ftm is not available.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/filtering.c b/libclamav/filtering.c
index 7b2ed67..dddbd0c 100644
--- a/libclamav/filtering.c
+++ b/libclamav/filtering.c
@@ -1,7 +1,7 @@
 /*
  *  A fast filter for static patterns.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/filtering.h b/libclamav/filtering.h
index b7c21f4..93ef542 100644
--- a/libclamav/filtering.h
+++ b/libclamav/filtering.h
@@ -1,7 +1,7 @@
 /*
  *  A fast filter for static patterns.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/fmap.c b/libclamav/fmap.c
index 26afcaa..9643c88 100644
--- a/libclamav/fmap.c
+++ b/libclamav/fmap.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
@@ -230,7 +230,7 @@ extern cl_fmap_t *cl_fmap_open_handle(void *handle, size_t offset, size_t len,
     }
 
     pages = fmap_align_items(len, pgsz);
-    hdrsz = fmap_align_to(sizeof(fmap_t) + (pages - 1) * sizeof(uint32_t), pgsz); /* fmap_t includes 1 bitmap slot, hence (pages-1) */
+    hdrsz = fmap_align_to(sizeof(fmap_t) + (pages - 1) * sizeof(uint64_t), pgsz); /* fmap_t includes 1 bitmap slot, hence (pages-1) */
     mapsz = pages * pgsz + hdrsz;
 
 #ifndef ANONYMOUS_MAP
@@ -351,12 +351,17 @@ static void fmap_aging(fmap_t *m)
 #endif
 }
 
-static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count, unsigned int lock_count)
+static int fmap_readpage(fmap_t *m, uint64_t first_page, uint32_t count, uint32_t lock_count)
 {
     size_t readsz = 0, eintr_off;
     char *pptr    = NULL, errtxt[256];
-    uint32_t s;
-    unsigned int i, page = first_page, force_read = 0;
+    uint32_t sbitmap;
+    uint64_t i, page = first_page, force_read = 0;
+
+    if ((size_t)(m->real_len) > (size_t)(UINT_MAX)) {
+        cli_dbgmsg("fmap_readage: size of file exceeds total prefaultible page size (unpacked file is too large)\n");
+        return 1;
+    }
 
     fmap_lock;
     for (i = 0; i < count; i++) { /* prefault */
@@ -377,14 +382,14 @@ static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count,
             /* we count one page too much to flush pending reads */
             if (!pptr) return 0; /* if we have any */
             force_read = 1;
-        } else if ((s = fmap_bitmap[page]) & FM_MASK_PAGED) {
+        } else if ((sbitmap = fmap_bitmap[page]) & FM_MASK_PAGED) {
             /* page already paged */
             if (lock) {
                 /* we want locking */
-                if (s & FM_MASK_LOCKED) {
+                if (sbitmap & FM_MASK_LOCKED) {
                     /* page already locked */
-                    s &= FM_MASK_COUNT;
-                    if (s == FM_MASK_COUNT) { /* lock count already at max: fial! */
+                    sbitmap &= FM_MASK_COUNT;
+                    if (sbitmap == FM_MASK_COUNT) { /* lock count already at max: fial! */
                         cli_errmsg("fmap_readpage: lock count exceeded\n");
                         return 1;
                     }
@@ -394,7 +399,7 @@ static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count,
                     fmap_bitmap[page] = 1 | FM_MASK_LOCKED | FM_MASK_PAGED;
             } else {
                 /* we don't want locking */
-                if (!(s & FM_MASK_LOCKED)) {
+                if (!(sbitmap & FM_MASK_LOCKED)) {
                     /* page is not locked: we reset aging to max */
                     fmap_bitmap[page] = FM_MASK_PAGED | FM_MASK_COUNT;
                 }
@@ -478,7 +483,7 @@ static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count,
 
 static const void *handle_need(fmap_t *m, size_t at, size_t len, int lock)
 {
-    unsigned int first_page, last_page, lock_count;
+    uint64_t first_page, last_page, lock_count;
     char *ret;
 
     if (!len)
diff --git a/libclamav/fmap.h b/libclamav/fmap.h
index 8074a03..13e62cd 100644
--- a/libclamav/fmap.h
+++ b/libclamav/fmap.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
@@ -47,8 +47,8 @@ struct cl_fmap {
     /* internal */
     time_t mtime;
     unsigned int pages;
-    unsigned int hdrsz;
-    unsigned int pgsz;
+    uint64_t hdrsz;
+    uint64_t pgsz;
     unsigned int paged;
     unsigned short aging;
     unsigned short dont_cache_flag;
diff --git a/libclamav/fpu.c b/libclamav/fpu.c
index f1d7d28..9d31623 100644
--- a/libclamav/fpu.c
+++ b/libclamav/fpu.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: Steven Morgan <smorgan@sourcefire.com>
diff --git a/libclamav/fpu.h b/libclamav/fpu.h
index 5244d3c..2715f69 100644
--- a/libclamav/fpu.h
+++ b/libclamav/fpu.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: Steven Morgan <smorgan@sourcefire.com>
diff --git a/libclamav/fsg.c b/libclamav/fsg.c
index eaab844..f31d097 100644
--- a/libclamav/fsg.c
+++ b/libclamav/fsg.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/fsg.h b/libclamav/fsg.h
index fb95df3..cb53deb 100644
--- a/libclamav/fsg.h
+++ b/libclamav/fsg.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/gpt.c b/libclamav/gpt.c
index c9163c2..db21be8 100644
--- a/libclamav/gpt.c
+++ b/libclamav/gpt.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <klin@sourcefire.com>
  *
diff --git a/libclamav/gpt.h b/libclamav/gpt.h
index 6298610..aab1e1d 100644
--- a/libclamav/gpt.h
+++ b/libclamav/gpt.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <klin@sourcefire.com>
  *
diff --git a/libclamav/hashtab.c b/libclamav/hashtab.c
index 2d2c068..ae26311 100644
--- a/libclamav/hashtab.c
+++ b/libclamav/hashtab.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/hashtab.h b/libclamav/hashtab.h
index 888ceb0..9388b06 100644
--- a/libclamav/hashtab.h
+++ b/libclamav/hashtab.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/hfsplus.c b/libclamav/hfsplus.c
index 3ddb929..6aead1b 100644
--- a/libclamav/hfsplus.c
+++ b/libclamav/hfsplus.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: David Raynor <draynor@sourcefire.com>
diff --git a/libclamav/hfsplus.h b/libclamav/hfsplus.h
index e548ee4..720392c 100644
--- a/libclamav/hfsplus.h
+++ b/libclamav/hfsplus.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: David Raynor <draynor@sourcefire.com>
diff --git a/libclamav/htmlnorm.c b/libclamav/htmlnorm.c
index b97109c..fbb569e 100644
--- a/libclamav/htmlnorm.c
+++ b/libclamav/htmlnorm.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog
diff --git a/libclamav/htmlnorm.h b/libclamav/htmlnorm.h
index 18bf851..9c7aadc 100644
--- a/libclamav/htmlnorm.h
+++ b/libclamav/htmlnorm.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog
diff --git a/libclamav/hwp.c b/libclamav/hwp.c
index 2992081..a3b6f1a 100644
--- a/libclamav/hwp.c
+++ b/libclamav/hwp.c
@@ -1,7 +1,7 @@
 /*
  * HWP Stuff
  *
- * Copyright (C) 2015-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2015-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Kevin Lin
  *
diff --git a/libclamav/hwp.h b/libclamav/hwp.h
index dd592b0..75d4d7b 100644
--- a/libclamav/hwp.h
+++ b/libclamav/hwp.h
@@ -1,7 +1,7 @@
 /*
  * HWP Stuff
  *
- * Copyright (C) 2015-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2015-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Kevin Lin
  *
diff --git a/libclamav/iowrap.c b/libclamav/iowrap.c
index 12b8e89..1a4af61 100644
--- a/libclamav/iowrap.c
+++ b/libclamav/iowrap.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2012-2013 Sourcefire, Inc.
  *
  *  Authors: Dave Raynor
diff --git a/libclamav/iowrap.h b/libclamav/iowrap.h
index c6b9c71..7257034 100644
--- a/libclamav/iowrap.h
+++ b/libclamav/iowrap.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2012-2013 Sourcefire, Inc.
  *
  *  Authors: Dave Raynor
diff --git a/libclamav/ishield.c b/libclamav/ishield.c
index 451dfc3..eaf551c 100644
--- a/libclamav/ishield.c
+++ b/libclamav/ishield.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/ishield.h b/libclamav/ishield.h
index 3405be0..b41279f 100644
--- a/libclamav/ishield.h
+++ b/libclamav/ishield.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/iso9660.c b/libclamav/iso9660.c
index bf1e3e7..5cb69d6 100644
--- a/libclamav/iso9660.c
+++ b/libclamav/iso9660.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2011-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/iso9660.h b/libclamav/iso9660.h
index 47f905a..aedb964 100644
--- a/libclamav/iso9660.h
+++ b/libclamav/iso9660.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2011-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/jpeg.c b/libclamav/jpeg.c
index a7dbfa5..29060a0 100644
--- a/libclamav/jpeg.c
+++ b/libclamav/jpeg.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2011-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm <tkojm@clamav.net>
diff --git a/libclamav/jpeg.h b/libclamav/jpeg.h
index a21023e..fa13215 100644
--- a/libclamav/jpeg.h
+++ b/libclamav/jpeg.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2011-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm <tkojm@clamav.net>
diff --git a/libclamav/json_api.c b/libclamav/json_api.c
index 85397db..21c8a46 100644
--- a/libclamav/json_api.c
+++ b/libclamav/json_api.c
@@ -1,7 +1,7 @@
 /*
  * JSON Object API
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Kevin Lin
  *
diff --git a/libclamav/json_api.h b/libclamav/json_api.h
index b414efa..c29fbc8 100644
--- a/libclamav/json_api.h
+++ b/libclamav/json_api.h
@@ -1,7 +1,7 @@
 /*
  * JSON Object API
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Kevin Lin
  *
diff --git a/libclamav/jsparse/js-norm.c b/libclamav/jsparse/js-norm.c
index 9b942cc..ff0d59e 100644
--- a/libclamav/jsparse/js-norm.c
+++ b/libclamav/jsparse/js-norm.c
@@ -1,7 +1,7 @@
 /*
  *  Javascript normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/jsparse/js-norm.h b/libclamav/jsparse/js-norm.h
index e64697a..1c466ca 100644
--- a/libclamav/jsparse/js-norm.h
+++ b/libclamav/jsparse/js-norm.h
@@ -1,7 +1,7 @@
 /*
  *  Javascript normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/jsparse/lexglobal.h b/libclamav/jsparse/lexglobal.h
index c3b9c26..ab885ca 100644
--- a/libclamav/jsparse/lexglobal.h
+++ b/libclamav/jsparse/lexglobal.h
@@ -1,7 +1,7 @@
 /*
  *  Javascript normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/libclamav.map b/libclamav/libclamav.map
index 3ab46c2..beebe91 100644
--- a/libclamav/libclamav.map
+++ b/libclamav/libclamav.map
@@ -257,6 +257,7 @@ CLAMAV_PRIVATE {
     cl_base64_decode;
     cl_base64_encode;
     cli_sanitize_filepath;
+    cli_gentemp_with_prefix;
 
     __cli_strcasestr;
     __cli_strndup;
diff --git a/libclamav/line.c b/libclamav/line.c
index 665cd96..fa2600d 100644
--- a/libclamav/line.c
+++ b/libclamav/line.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/line.h b/libclamav/line.h
index b47fc36..e0f0f74 100644
--- a/libclamav/line.h
+++ b/libclamav/line.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/lzma_iface.c b/libclamav/lzma_iface.c
index 94ece8a..a9e8d63 100644
--- a/libclamav/lzma_iface.c
+++ b/libclamav/lzma_iface.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB
diff --git a/libclamav/lzma_iface.h b/libclamav/lzma_iface.h
index 0359e71..15399c8 100644
--- a/libclamav/lzma_iface.h
+++ b/libclamav/lzma_iface.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/macho.c b/libclamav/macho.c
index 4189bac..6f5c144 100644
--- a/libclamav/macho.c
+++ b/libclamav/macho.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm <tkojm@clamav.net>
diff --git a/libclamav/macho.h b/libclamav/macho.h
index f588240..5449c66 100644
--- a/libclamav/macho.h
+++ b/libclamav/macho.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm <tkojm@clamav.net>
diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c
index 087be67..70eae9a 100644
--- a/libclamav/matcher-ac.c
+++ b/libclamav/matcher-ac.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/matcher-ac.h b/libclamav/matcher-ac.h
index 6720deb..3acd2f2 100644
--- a/libclamav/matcher-ac.h
+++ b/libclamav/matcher-ac.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/matcher-bm.c b/libclamav/matcher-bm.c
index e38a3cc..d7ce5f8 100644
--- a/libclamav/matcher-bm.c
+++ b/libclamav/matcher-bm.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/matcher-bm.h b/libclamav/matcher-bm.h
index 1a80788..73dde6f 100644
--- a/libclamav/matcher-bm.h
+++ b/libclamav/matcher-bm.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/matcher-byte-comp.c b/libclamav/matcher-byte-comp.c
index 4289b12..fd038d1 100644
--- a/libclamav/matcher-byte-comp.c
+++ b/libclamav/matcher-byte-comp.c
@@ -1,7 +1,7 @@
 /*
  *  Byte comparison matcher support functions
  *
- *  Copyright (C) 2018-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2018-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Mickey Sola
  *
@@ -122,6 +122,12 @@ cl_error_t cli_bcomp_addpatt(struct cli_matcher *root, const char *virname, cons
         return CL_EMALFDB;
     }
 
+    if (ref_subsigid > MAX_LDB_SUBSIGS) {
+        cli_errmsg("cli_bcomp_addpatt: while byte compare subsig parsing, reference subigid exceeded limits on max LDB subsigs\n");
+        cli_bcomp_freemeta(root, bcomp);
+        return CL_EMALFDB;
+    }
+
     bcomp->ref_subsigid = ref_subsigid;
 
     /* use the passed hexsig buffer to find the start and ending parens and store the param length (minus starting paren) */
@@ -479,7 +485,7 @@ cl_error_t cli_bcomp_scanbuf(const unsigned char *buffer, size_t buffer_length,
         if (bcomp->lsigid[0]) {
 
             subsigid = cli_calloc(3, sizeof(char));
-            sprintf(subsigid, "%hu", bcomp->ref_subsigid);
+            snprintf(subsigid, 3, "%hu", bcomp->ref_subsigid);
 
             /* verify the ref_subsigid */
             if (cli_ac_chklsig(subsigid, subsigid + strlen(subsigid),
@@ -540,6 +546,11 @@ cl_error_t cli_bcomp_scanbuf(const unsigned char *buffer, size_t buffer_length,
         }
     }
 
+    if (subsigid) {
+        free(subsigid);
+        subsigid = NULL;
+    }
+
     if (ret == CL_SUCCESS && viruses_found) {
         return CL_VIRUS;
     }
diff --git a/libclamav/matcher-byte-comp.h b/libclamav/matcher-byte-comp.h
index 135b3bd..06d3b42 100644
--- a/libclamav/matcher-byte-comp.h
+++ b/libclamav/matcher-byte-comp.h
@@ -1,7 +1,7 @@
 /*
  *  Support for matcher using byte compare
  *
- *  Copyright (C) 2018-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2018-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Mickey Sola
  *
diff --git a/libclamav/matcher-hash.c b/libclamav/matcher-hash.c
index bd743dc..a12a3e9 100644
--- a/libclamav/matcher-hash.c
+++ b/libclamav/matcher-hash.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2010-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB
diff --git a/libclamav/matcher-hash.h b/libclamav/matcher-hash.h
index 6d78c76..a0ae861 100644
--- a/libclamav/matcher-hash.h
+++ b/libclamav/matcher-hash.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2010-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB
diff --git a/libclamav/matcher-pcre.c b/libclamav/matcher-pcre.c
index ea36fa6..7f1646a 100644
--- a/libclamav/matcher-pcre.c
+++ b/libclamav/matcher-pcre.c
@@ -1,7 +1,7 @@
 /*
  *  Support for matcher using PCRE
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Kevin Lin
diff --git a/libclamav/matcher-pcre.h b/libclamav/matcher-pcre.h
index 7b0baa3..92dd577 100644
--- a/libclamav/matcher-pcre.h
+++ b/libclamav/matcher-pcre.h
@@ -1,7 +1,7 @@
 /*
  *  Support for matcher using PCRE
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Kevin Lin
diff --git a/libclamav/matcher.c b/libclamav/matcher.c
index 963e74d..86e6c43 100644
--- a/libclamav/matcher.c
+++ b/libclamav/matcher.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/matcher.h b/libclamav/matcher.h
index 0a1e179..712c272 100644
--- a/libclamav/matcher.h
+++ b/libclamav/matcher.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/mbox.c b/libclamav/mbox.c
index 1a308ae..31ddcc7 100644
--- a/libclamav/mbox.c
+++ b/libclamav/mbox.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
@@ -955,6 +955,7 @@ parseEmailFile(fmap_t *map, size_t *at, const table_t *rfc821, const char *first
 
                         totalHeaderCnt++;
                         if (haveTooManyEmailHeaders(totalHeaderCnt, ctx, heuristicFound)) {
+                            DO_FREE(header);
                             break;
                         }
                         needContinue = (parseEmailHeader(ret, header, rfc821, ctx, heuristicFound) < 0);
@@ -1067,6 +1068,8 @@ parseEmailFile(fmap_t *map, size_t *at, const table_t *rfc821, const char *first
                 {
                     char *header     = getMallocedBufferFromList(head); /*This is the issue */
                     int needContinue = 0;
+                    DO_VERIFY_POINTER(header);
+
                     needContinue     = (header[strlen(header) - 1] == ';');
                     if (0 == needContinue) {
                         needContinue = (line && (count_quotes(header) & 1));
@@ -1075,6 +1078,7 @@ parseEmailFile(fmap_t *map, size_t *at, const table_t *rfc821, const char *first
                     if (0 == needContinue) {
                         totalHeaderCnt++;
                         if (haveTooManyEmailHeaders(totalHeaderCnt, ctx, heuristicFound)) {
+                            DO_FREE(header);
                             break;
                         }
                         needContinue = (parseEmailHeader(ret, header, rfc821, ctx, heuristicFound) < 0);
diff --git a/libclamav/mbox.h b/libclamav/mbox.h
index b07a262..2bb0c49 100644
--- a/libclamav/mbox.h
+++ b/libclamav/mbox.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/mbr.c b/libclamav/mbr.c
index 80457bf..ecc46c8 100644
--- a/libclamav/mbr.c
+++ b/libclamav/mbr.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <klin@sourcefire.com>
  *
diff --git a/libclamav/mbr.h b/libclamav/mbr.h
index 796e911..e6a5bde 100644
--- a/libclamav/mbr.h
+++ b/libclamav/mbr.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <klin@sourcefire.com>
  *
diff --git a/libclamav/message.c b/libclamav/message.c
index 41b04d1..875cf1b 100644
--- a/libclamav/message.c
+++ b/libclamav/message.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/message.h b/libclamav/message.h
index cb73c82..df91c19 100644
--- a/libclamav/message.h
+++ b/libclamav/message.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/mew.c b/libclamav/mew.c
index b550b21..2b52d4f 100644
--- a/libclamav/mew.c
+++ b/libclamav/mew.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Michal 'GiM' Spadlinski
diff --git a/libclamav/mew.h b/libclamav/mew.h
index cb48a72..12fb23c 100644
--- a/libclamav/mew.h
+++ b/libclamav/mew.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Michal 'GiM' Spadlinski
diff --git a/libclamav/mpool.c b/libclamav/mpool.c
index 4bc0729..45b8ad7 100644
--- a/libclamav/mpool.c
+++ b/libclamav/mpool.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/mpool.h b/libclamav/mpool.h
index b4da95b..e0f726a 100644
--- a/libclamav/mpool.h
+++ b/libclamav/mpool.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/msdoc.c b/libclamav/msdoc.c
index f7324d0..4736c72 100644
--- a/libclamav/msdoc.c
+++ b/libclamav/msdoc.c
@@ -1,7 +1,7 @@
 /*
  * Extract component parts of OLE2 files (e.g. MS Office Documents)
  *
- * Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  * Authors: Kevin Lin
diff --git a/libclamav/msdoc.h b/libclamav/msdoc.h
index 577f27e..7d362c3 100644
--- a/libclamav/msdoc.h
+++ b/libclamav/msdoc.h
@@ -1,7 +1,7 @@
 /*
  *  Extract component parts of OLE2 files (e.g. MS Office Documents)
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Kevin Lin
diff --git a/libclamav/msexpand.c b/libclamav/msexpand.c
index 07ec28c..cee4487 100644
--- a/libclamav/msexpand.c
+++ b/libclamav/msexpand.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/msexpand.h b/libclamav/msexpand.h
index ba7c85d..632b84c 100644
--- a/libclamav/msexpand.h
+++ b/libclamav/msexpand.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/msxml.c b/libclamav/msxml.c
index a58ad07..00fd0d0 100644
--- a/libclamav/msxml.c
+++ b/libclamav/msxml.c
@@ -1,7 +1,7 @@
 /*
  * Extract component parts of MS XML files (e.g. MS Office 2003 XML Documents)
  *
- * Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  * Authors: Kevin Lin
diff --git a/libclamav/msxml.h b/libclamav/msxml.h
index dc2a4c6..cb97d06 100644
--- a/libclamav/msxml.h
+++ b/libclamav/msxml.h
@@ -1,7 +1,7 @@
 /*
  *  Extract component parts of MS XML files (e.g. MS Office 2003 XML Documents)
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Kevin Lin
diff --git a/libclamav/msxml_parser.c b/libclamav/msxml_parser.c
index 640f048..9af5335 100644
--- a/libclamav/msxml_parser.c
+++ b/libclamav/msxml_parser.c
@@ -1,7 +1,7 @@
 /*
  * Extract component parts of various MS XML files (e.g. MS Office 2003 XML Documents)
  *
- * Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  * Authors: Kevin Lin
diff --git a/libclamav/msxml_parser.h b/libclamav/msxml_parser.h
index 5c7c331..cd1b456 100644
--- a/libclamav/msxml_parser.h
+++ b/libclamav/msxml_parser.h
@@ -1,7 +1,7 @@
 /*
  * Extract component parts of various MS XML files (e.g. MS Office 2003 XML Documents)
  *
- * Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  * Authors: Kevin Lin
diff --git a/libclamav/ole2_extract.c b/libclamav/ole2_extract.c
index 0db81f3..1d97e8b 100644
--- a/libclamav/ole2_extract.c
+++ b/libclamav/ole2_extract.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog
diff --git a/libclamav/ole2_extract.h b/libclamav/ole2_extract.h
index 4a37eac..737967b 100644
--- a/libclamav/ole2_extract.h
+++ b/libclamav/ole2_extract.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog
diff --git a/libclamav/ooxml.c b/libclamav/ooxml.c
index 0838412..a331311 100644
--- a/libclamav/ooxml.c
+++ b/libclamav/ooxml.c
@@ -1,7 +1,7 @@
 /*
  * OOXML JSON Internals
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Kevin Lin
  *
diff --git a/libclamav/ooxml.h b/libclamav/ooxml.h
index cf170b5..a486d11 100644
--- a/libclamav/ooxml.h
+++ b/libclamav/ooxml.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin
  *
diff --git a/libclamav/openioc.c b/libclamav/openioc.c
index 5006ae4..8773297 100644
--- a/libclamav/openioc.c
+++ b/libclamav/openioc.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Steven Morgan <smorgan@sourcefire.com>
  *
diff --git a/libclamav/openioc.h b/libclamav/openioc.h
index 8ba16d7..6b4731b 100644
--- a/libclamav/openioc.h
+++ b/libclamav/openioc.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Steven Morgan <smorgan@sourcefire.com>
  *
diff --git a/libclamav/others.c b/libclamav/others.c
index 497c325..4f4262a 100644
--- a/libclamav/others.c
+++ b/libclamav/others.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm, Trog
diff --git a/libclamav/others.h b/libclamav/others.h
index dbb0496..4e57fc2 100644
--- a/libclamav/others.h
+++ b/libclamav/others.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
@@ -71,7 +71,7 @@
  * in re-enabling affected modules.
  */
 
-#define CL_FLEVEL 112
+#define CL_FLEVEL 113
 #define CL_FLEVEL_DCONF CL_FLEVEL
 #define CL_FLEVEL_SIGTOOL CL_FLEVEL
 
@@ -493,6 +493,7 @@ extern int have_rar;
 #define SCAN_COLLECT_METADATA (ctx->options->general & CL_SCAN_GENERAL_COLLECT_METADATA)
 #define SCAN_HEURISTICS (ctx->options->general & CL_SCAN_GENERAL_HEURISTICS)
 #define SCAN_HEURISTIC_PRECEDENCE (ctx->options->general & CL_SCAN_GENERAL_HEURISTIC_PRECEDENCE)
+#define SCAN_UNPRIVILEGED (ctx->options->general & CL_SCAN_GENERAL_UNPRIVILEGED)
 
 #define SCAN_PARSE_ARCHIVE (ctx->options->parse & CL_SCAN_PARSE_ARCHIVE)
 #define SCAN_PARSE_ELF (ctx->options->parse & CL_SCAN_PARSE_ELF)
diff --git a/libclamav/others_common.c b/libclamav/others_common.c
index d8a7f15..30dde78 100644
--- a/libclamav/others_common.c
+++ b/libclamav/others_common.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm, Trog
diff --git a/libclamav/packlibs.c b/libclamav/packlibs.c
index d118714..ba96a46 100644
--- a/libclamav/packlibs.c
+++ b/libclamav/packlibs.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu, Michal 'GiM' Spadlinski
diff --git a/libclamav/packlibs.h b/libclamav/packlibs.h
index 7d560ee..5bdcf0c 100644
--- a/libclamav/packlibs.h
+++ b/libclamav/packlibs.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu, Michal 'GiM' Spadlinski
diff --git a/libclamav/pdf.c b/libclamav/pdf.c
index a4ef923..0464662 100644
--- a/libclamav/pdf.c
+++ b/libclamav/pdf.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne, Török Edvin
@@ -1584,9 +1584,14 @@ int pdf_extract_obj(struct pdf_struct *pdf, struct pdf_obj *obj, uint32_t flags)
             cli_dbgmsg("Error decoding stream! Error code: %d\n", rc);
 
             /* It's ok if we couldn't decode the stream,
-             *   make a best effort to keep parsing. */
-            if (CL_EPARSE == rc)
+             *   make a best effort to keep parsing...
+             *   Unless we were unable to allocate memory.*/
+            if (CL_EMEM == rc) {
+                goto err;
+            }
+            if (CL_EPARSE == rc) {
                 rc = CL_SUCCESS;
+            }
 
             if (NULL != objstm) {
                 /*
@@ -1764,11 +1769,14 @@ int pdf_extract_obj(struct pdf_struct *pdf, struct pdf_obj *obj, uint32_t flags)
         }
     }
 
+err:
     close(fout);
 
+    if (CL_EMEM != rc) {
         if (flags & PDF_EXTRACT_OBJ_SCAN && !pdf->ctx->engine->keeptmp)
             if (cli_unlink(fullname) && rc != CL_VIRUS)
                 rc = CL_EUNLINK;
+    }
 
     return rc;
 }
@@ -3481,7 +3489,10 @@ int cli_pdf(const char *dir, cli_ctx *ctx, off_t offset)
     objs_found = pdf.nobjs;
     rc         = pdf_find_and_extract_objs(&pdf, &alerts);
 
-    if (pdf.nobjs <= objs_found) {
+    if (CL_EMEM == rc) {
+        cli_dbgmsg("cli_pdf: pdf_find_and_extract_objs had an allocation failure\n");
+        goto err;
+    } else if (pdf.nobjs <= objs_found) {
         cli_dbgmsg("cli_pdf: pdf_find_and_extract_objs did not find any new objects!\n");
     } else {
         cli_dbgmsg("cli_pdf: pdf_find_and_extract_objs found %d new objects.\n", pdf.nobjs - objs_found);
@@ -3532,6 +3543,7 @@ int cli_pdf(const char *dir, cli_ctx *ctx, off_t offset)
     pdf_export_json(&pdf);
 #endif
 
+err:
     if (pdf.objstms) {
         for (i = 0; i < pdf.nobjstms; i++) {
             if (pdf.objstms[i]) {
diff --git a/libclamav/pdf.h b/libclamav/pdf.h
index f80a138..dd5e58b 100644
--- a/libclamav/pdf.h
+++ b/libclamav/pdf.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/pdfdecode.c b/libclamav/pdfdecode.c
index 626244d..8315f3a 100644
--- a/libclamav/pdfdecode.c
+++ b/libclamav/pdfdecode.c
@@ -68,6 +68,8 @@
 
 #define PDFTOKEN_FLAG_XREF 0x1
 
+#define INFLATE_CHUNK_SIZE (1024 * 256)
+
 struct pdf_token {
     uint32_t flags;   /* tracking flags */
     uint32_t success; /* successfully decoded filters */
@@ -294,10 +296,13 @@ static size_t pdf_decodestream_internal(
 
             case OBJ_FILTER_JPX:
                 if (!filter) filter = "JPXDECODE";
+                /* fallthrough */
             case OBJ_FILTER_DCT:
                 if (!filter) filter = "DCTDECODE";
+                /* fallthrough */
             case OBJ_FILTER_FAX:
                 if (!filter) filter = "FAXDECODE";
+                /* fallthrough */
             case OBJ_FILTER_JBIG2:
                 if (!filter) filter = "JBIG2DECODE";
 
@@ -564,11 +569,12 @@ static cl_error_t filter_rldecode(struct pdf_struct *pdf, struct pdf_obj *obj, s
 
     UNUSEDPARAM(obj);
 
-    if (!(decoded = cli_calloc(BUFSIZ, sizeof(uint8_t)))) {
+    capacity = INFLATE_CHUNK_SIZE;
+
+    if (!(decoded = (uint8_t *)cli_malloc(capacity))) {
         cli_errmsg("cli_pdf: cannot allocate memory for decoded output\n");
         return CL_EMEM;
     }
-    capacity = BUFSIZ;
 
     while (offset < length) {
         uint8_t srclen = content[offset++];
@@ -581,16 +587,17 @@ static cl_error_t filter_rldecode(struct pdf_struct *pdf, struct pdf_obj *obj, s
                 break;
             }
             if (declen + srclen + 1 > capacity) {
-                if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + BUFSIZ, 0, 0)) != CL_SUCCESS)
+
+                if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + INFLATE_CHUNK_SIZE, 0, 0)) != CL_SUCCESS)
                     break;
 
-                if (!(temp = cli_realloc(decoded, capacity + BUFSIZ))) {
+                if (!(temp = cli_realloc(decoded, capacity + INFLATE_CHUNK_SIZE))) {
                     cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
                     rc = CL_EMEM;
                     break;
                 }
                 decoded = temp;
-                capacity += BUFSIZ;
+                capacity += INFLATE_CHUNK_SIZE;
             }
 
             memcpy(decoded + declen, content + offset, srclen + 1);
@@ -605,16 +612,18 @@ static cl_error_t filter_rldecode(struct pdf_struct *pdf, struct pdf_obj *obj, s
                 break;
             }
             if (declen + (257 - srclen) + 1 > capacity) {
-                if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + BUFSIZ, 0, 0)) != CL_SUCCESS)
+                if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + INFLATE_CHUNK_SIZE, 0, 0)) != CL_SUCCESS) {
+                    cli_dbgmsg("cli_pdf: required buffer size to inflate compressed filter exceeds maximum: %u\n", capacity + INFLATE_CHUNK_SIZE);
                     break;
+                }
 
-                if (!(temp = cli_realloc(decoded, capacity + BUFSIZ))) {
+                if (!(temp = cli_realloc(decoded, capacity + INFLATE_CHUNK_SIZE))) {
                     cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
                     rc = CL_EMEM;
                     break;
                 }
                 decoded = temp;
-                capacity += BUFSIZ;
+                capacity += INFLATE_CHUNK_SIZE;
             }
 
             memset(decoded + declen, content[offset], 257 - srclen);
@@ -628,6 +637,16 @@ static cl_error_t filter_rldecode(struct pdf_struct *pdf, struct pdf_obj *obj, s
         }
     }
 
+    if (rc == CL_SUCCESS) {
+        /* Shrink output buffer to final the decoded data length to minimize RAM usage */
+        if (!(temp = cli_realloc(decoded, declen))) {
+            cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
+            rc = CL_EMEM;
+        } else {
+            decoded = temp;
+        }
+    }
+
     if (rc == CL_SUCCESS) {
         free(token->content);
 
@@ -684,17 +703,18 @@ static cl_error_t filter_flatedecode(struct pdf_struct *pdf, struct pdf_obj *obj
             return CL_SUCCESS;
     }
 
-    if (!(decoded = (uint8_t *)cli_calloc(BUFSIZ, sizeof(uint8_t)))) {
+    capacity = INFLATE_CHUNK_SIZE;
+
+    if (!(decoded = (uint8_t *)cli_malloc(capacity))) {
         cli_errmsg("cli_pdf: cannot allocate memory for decoded output\n");
         return CL_EMEM;
     }
-    capacity = BUFSIZ;
 
     memset(&stream, 0, sizeof(stream));
     stream.next_in   = (Bytef *)content;
     stream.avail_in  = length;
     stream.next_out  = (Bytef *)decoded;
-    stream.avail_out = BUFSIZ;
+    stream.avail_out = INFLATE_CHUNK_SIZE;
 
     zstat = inflateInit(&stream);
     if (zstat != Z_OK) {
@@ -706,7 +726,7 @@ static cl_error_t filter_flatedecode(struct pdf_struct *pdf, struct pdf_obj *obj
     /* initial inflate */
     zstat = inflate(&stream, Z_NO_FLUSH);
     /* check if nothing written whatsoever */
-    if ((zstat != Z_OK) && (stream.avail_out == BUFSIZ)) {
+    if ((zstat != Z_OK) && (stream.avail_out == INFLATE_CHUNK_SIZE)) {
         /* skip till EOL, and try inflating from there, sometimes
          * PDFs contain extra whitespace */
         uint8_t *q = decode_nextlinestart(content, length);
@@ -736,19 +756,21 @@ static cl_error_t filter_flatedecode(struct pdf_struct *pdf, struct pdf_obj *obj
     while (zstat == Z_OK && stream.avail_in) {
         /* extend output capacity if needed,*/
         if (stream.avail_out == 0) {
-            if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + BUFSIZ, 0, 0)) != CL_SUCCESS)
+            if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + INFLATE_CHUNK_SIZE, 0, 0)) != CL_SUCCESS) {
+                cli_dbgmsg("cli_pdf: required buffer size to inflate compressed filter exceeds maximum: %u\n", capacity + INFLATE_CHUNK_SIZE);
                 break;
+            }
 
-            if (!(temp = cli_realloc(decoded, capacity + BUFSIZ))) {
+            if (!(temp = cli_realloc(decoded, capacity + INFLATE_CHUNK_SIZE))) {
                 cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
                 rc = CL_EMEM;
                 break;
             }
             decoded          = temp;
             stream.next_out  = decoded + capacity;
-            stream.avail_out = BUFSIZ;
-            declen += BUFSIZ;
-            capacity += BUFSIZ;
+            stream.avail_out = INFLATE_CHUNK_SIZE;
+            declen += INFLATE_CHUNK_SIZE;
+            capacity += INFLATE_CHUNK_SIZE;
         }
 
         /* continue inflation */
@@ -756,7 +778,7 @@ static cl_error_t filter_flatedecode(struct pdf_struct *pdf, struct pdf_obj *obj
     }
 
     /* add stream end fragment to decoded length */
-    declen += (BUFSIZ - stream.avail_out);
+    declen += (INFLATE_CHUNK_SIZE - stream.avail_out);
 
     /* error handling */
     switch (zstat) {
@@ -794,6 +816,16 @@ static cl_error_t filter_flatedecode(struct pdf_struct *pdf, struct pdf_obj *obj
 
     (void)inflateEnd(&stream);
 
+    if (rc == CL_SUCCESS) {
+        /* Shrink output buffer to final the decoded data length to minimize RAM usage */
+        if (!(temp = cli_realloc(decoded, declen))) {
+            cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
+            rc = CL_EMEM;
+        } else {
+            decoded = temp;
+        }
+    }
+
     if (rc == CL_SUCCESS) {
         free(token->content);
 
@@ -950,17 +982,18 @@ static cl_error_t filter_lzwdecode(struct pdf_struct *pdf, struct pdf_obj *obj,
             return CL_SUCCESS;
     }
 
-    if (!(decoded = (uint8_t *)cli_calloc(BUFSIZ, sizeof(uint8_t)))) {
+    capacity = INFLATE_CHUNK_SIZE;
+
+    if (!(decoded = (uint8_t *)cli_malloc(capacity))) {
         cli_errmsg("cli_pdf: cannot allocate memory for decoded output\n");
         return CL_EMEM;
     }
-    capacity = BUFSIZ;
 
     memset(&stream, 0, sizeof(stream));
     stream.next_in   = content;
     stream.avail_in  = length;
     stream.next_out  = decoded;
-    stream.avail_out = BUFSIZ;
+    stream.avail_out = INFLATE_CHUNK_SIZE;
     if (echg)
         stream.flags |= LZW_FLAG_EARLYCHG;
 
@@ -974,7 +1007,7 @@ static cl_error_t filter_lzwdecode(struct pdf_struct *pdf, struct pdf_obj *obj,
     /* initial inflate */
     lzwstat = lzwInflate(&stream);
     /* check if nothing written whatsoever */
-    if ((lzwstat != Z_OK) && (stream.avail_out == BUFSIZ)) {
+    if ((lzwstat != Z_OK) && (stream.avail_out == INFLATE_CHUNK_SIZE)) {
         /* skip till EOL, and try inflating from there, sometimes
          * PDFs contain extra whitespace */
         uint8_t *q = decode_nextlinestart(content, length);
@@ -1004,19 +1037,21 @@ static cl_error_t filter_lzwdecode(struct pdf_struct *pdf, struct pdf_obj *obj,
     while (lzwstat == Z_OK && stream.avail_in) {
         /* extend output capacity if needed,*/
         if (stream.avail_out == 0) {
-            if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + BUFSIZ, 0, 0)) != CL_SUCCESS)
+            if ((rc = cli_checklimits("pdf", pdf->ctx, capacity + INFLATE_CHUNK_SIZE, 0, 0)) != CL_SUCCESS) {
+                cli_dbgmsg("cli_pdf: required buffer size to inflate compressed filter exceeds maximum: %u\n", capacity + INFLATE_CHUNK_SIZE);
                 break;
+            }
 
-            if (!(temp = cli_realloc(decoded, capacity + BUFSIZ))) {
+            if (!(temp = cli_realloc(decoded, capacity + INFLATE_CHUNK_SIZE))) {
                 cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
                 rc = CL_EMEM;
                 break;
             }
             decoded          = temp;
             stream.next_out  = decoded + capacity;
-            stream.avail_out = BUFSIZ;
-            declen += BUFSIZ;
-            capacity += BUFSIZ;
+            stream.avail_out = INFLATE_CHUNK_SIZE;
+            declen += INFLATE_CHUNK_SIZE;
+            capacity += INFLATE_CHUNK_SIZE;
         }
 
         /* continue inflation */
@@ -1024,7 +1059,7 @@ static cl_error_t filter_lzwdecode(struct pdf_struct *pdf, struct pdf_obj *obj,
     }
 
     /* add stream end fragment to decoded length */
-    declen += (BUFSIZ - stream.avail_out);
+    declen += (INFLATE_CHUNK_SIZE - stream.avail_out);
 
     /* error handling */
     switch (lzwstat) {
@@ -1063,6 +1098,16 @@ static cl_error_t filter_lzwdecode(struct pdf_struct *pdf, struct pdf_obj *obj,
 
     (void)lzwInflateEnd(&stream);
 
+    if (rc == CL_SUCCESS) {
+        /* Shrink output buffer to final the decoded data length to minimize RAM usage */
+        if (!(temp = cli_realloc(decoded, declen))) {
+            cli_errmsg("cli_pdf: cannot reallocate memory for decoded output\n");
+            rc = CL_EMEM;
+        } else {
+            decoded = temp;
+        }
+    }
+
     if (rc == CL_SUCCESS) {
         free(token->content);
 
diff --git a/libclamav/pe.c b/libclamav/pe.c
index 499e428..6ea1997 100644
--- a/libclamav/pe.c
+++ b/libclamav/pe.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu, Tomasz Kojm, Andrew Williams
diff --git a/libclamav/pe.h b/libclamav/pe.h
index 506dee7..11afa17 100644
--- a/libclamav/pe.h
+++ b/libclamav/pe.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu, Tomasz Kojm, Andrew Williams
diff --git a/libclamav/pe_icons.c b/libclamav/pe_icons.c
index cd541c0..f4d5ddd 100644
--- a/libclamav/pe_icons.c
+++ b/libclamav/pe_icons.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/pe_icons.h b/libclamav/pe_icons.h
index 81b36a6..ffa9b88 100644
--- a/libclamav/pe_icons.h
+++ b/libclamav/pe_icons.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/pe_structs.h b/libclamav/pe_structs.h
index 81a5feb..a8075cb 100644
--- a/libclamav/pe_structs.h
+++ b/libclamav/pe_structs.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu, Tomasz Kojm, Andrew Williams
diff --git a/libclamav/perflogging.c b/libclamav/perflogging.c
index 4b8de60..a832cb7 100644
--- a/libclamav/perflogging.c
+++ b/libclamav/perflogging.c
@@ -1,7 +1,7 @@
 /*
  *  Gather statistics from performance sensitive code.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/perflogging.h b/libclamav/perflogging.h
index e719513..12a1946 100644
--- a/libclamav/perflogging.h
+++ b/libclamav/perflogging.h
@@ -1,7 +1,7 @@
 /*
  *  Gather statistics from performance sensitive code.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/petite.c b/libclamav/petite.c
index f2fece6..e25598e 100644
--- a/libclamav/petite.c
+++ b/libclamav/petite.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/petite.h b/libclamav/petite.h
index 096a3bc..f862559 100644
--- a/libclamav/petite.h
+++ b/libclamav/petite.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/phish_domaincheck_db.c b/libclamav/phish_domaincheck_db.c
index 32514fe..e3b73f0 100644
--- a/libclamav/phish_domaincheck_db.c
+++ b/libclamav/phish_domaincheck_db.c
@@ -1,7 +1,7 @@
 /*
  *  Phishing module: domain list implementation.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/phish_domaincheck_db.h b/libclamav/phish_domaincheck_db.h
index a5727ca..bbd2898 100644
--- a/libclamav/phish_domaincheck_db.h
+++ b/libclamav/phish_domaincheck_db.h
@@ -1,7 +1,7 @@
 /*
  *  Phishing module: domain list implementation.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/phish_whitelist.c b/libclamav/phish_whitelist.c
index 65234ed..75da4ad 100644
--- a/libclamav/phish_whitelist.c
+++ b/libclamav/phish_whitelist.c
@@ -1,7 +1,7 @@
 /*
  *  Phishing module: whitelist implementation.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/phish_whitelist.h b/libclamav/phish_whitelist.h
index 81171c9..c82c1ce 100644
--- a/libclamav/phish_whitelist.h
+++ b/libclamav/phish_whitelist.h
@@ -1,7 +1,7 @@
 /*
  *  Phishing module: whitelist implementation.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/phishcheck.c b/libclamav/phishcheck.c
index be7d19c..375324a 100644
--- a/libclamav/phishcheck.c
+++ b/libclamav/phishcheck.c
@@ -1,7 +1,7 @@
 /*
  *  Detect phishing, based on URL spoofing detection.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/phishcheck.h b/libclamav/phishcheck.h
index f1b2440..5553575 100644
--- a/libclamav/phishcheck.h
+++ b/libclamav/phishcheck.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/png.c b/libclamav/png.c
index 3fe4b3a..9bb6532 100644
--- a/libclamav/png.c
+++ b/libclamav/png.c
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *   Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *   Copyright (C) 2011-2013 Sourcefire, Inc.
  *   Copyright (C) 1995-2007 by Alexander Lehmann <lehmann@usa.net>,
  *                              Andreas Dilger <adilger@enel.ucalgary.ca>,
diff --git a/libclamav/png.h b/libclamav/png.h
index a134485..9dfac84 100644
--- a/libclamav/png.h
+++ b/libclamav/png.h
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *   Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *   Copyright (C) 2011-2013 Sourcefire, Inc.
  *   Copyright (C) 1995-2007 by Alexander Lehmann <lehmann@usa.net>,
  *                              Andreas Dilger <adilger@enel.ucalgary.ca>,
diff --git a/libclamav/prtn_intxn.c b/libclamav/prtn_intxn.c
index 195c3c3..3964148 100644
--- a/libclamav/prtn_intxn.c
+++ b/libclamav/prtn_intxn.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <klin@sourcefire.com>
  *
diff --git a/libclamav/prtn_intxn.h b/libclamav/prtn_intxn.h
index d2a9800..183598d 100644
--- a/libclamav/prtn_intxn.h
+++ b/libclamav/prtn_intxn.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <klin@sourcefire.com>
  *
diff --git a/libclamav/readdb.c b/libclamav/readdb.c
index 59c8c56..b271526 100644
--- a/libclamav/readdb.c
+++ b/libclamav/readdb.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
@@ -88,8 +88,6 @@ static pthread_mutex_t cli_ref_mutex = PTHREAD_MUTEX_INITIALIZER;
 #include "yara_lexer.h"
 #endif
 
-#define MAX_LDB_SUBSIGS 64
-
 char *cli_virname(const char *virname, unsigned int official)
 {
     char *newname, *pt;
diff --git a/libclamav/readdb.h b/libclamav/readdb.h
index c56f8d4..075281c 100644
--- a/libclamav/readdb.h
+++ b/libclamav/readdb.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
@@ -31,6 +31,8 @@
 #include "str.h"
 #include "cvd.h"
 
+#define MAX_LDB_SUBSIGS 64
+
 struct cli_matcher;
 
 /* NOTE: We don't include .info in CLI_DBEXT because they are only used for
diff --git a/libclamav/rebuildpe.c b/libclamav/rebuildpe.c
index 7bc6b1e..29b29fe 100644
--- a/libclamav/rebuildpe.c
+++ b/libclamav/rebuildpe.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/rebuildpe.h b/libclamav/rebuildpe.h
index 44e0962..1ed51a7 100644
--- a/libclamav/rebuildpe.h
+++ b/libclamav/rebuildpe.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/regex_list.c b/libclamav/regex_list.c
index 2e3a066..a0fd447 100644
--- a/libclamav/regex_list.c
+++ b/libclamav/regex_list.c
@@ -1,7 +1,7 @@
 /*
  *  Match a string against a list of patterns/regexes.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/regex_list.h b/libclamav/regex_list.h
index f954a9a..f06433f 100644
--- a/libclamav/regex_list.h
+++ b/libclamav/regex_list.h
@@ -1,7 +1,7 @@
 /*
  *  Match a string against a list of patterns/regexes.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/regex_pcre.c b/libclamav/regex_pcre.c
index bea351d..fd1c219 100644
--- a/libclamav/regex_pcre.c
+++ b/libclamav/regex_pcre.c
@@ -1,7 +1,7 @@
 /*
  *  Support for PCRE regex variant
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Kevin Lin
diff --git a/libclamav/regex_pcre.h b/libclamav/regex_pcre.h
index c41ddab..7724ef5 100644
--- a/libclamav/regex_pcre.h
+++ b/libclamav/regex_pcre.h
@@ -1,7 +1,7 @@
 /*
  *  Support for PCRE regex variant
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Kevin Lin
diff --git a/libclamav/regex_suffix.c b/libclamav/regex_suffix.c
index 76cbc74..231fb90 100644
--- a/libclamav/regex_suffix.c
+++ b/libclamav/regex_suffix.c
@@ -1,7 +1,7 @@
 /*
  *  Parse a regular expression, and extract a static suffix.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/regex_suffix.h b/libclamav/regex_suffix.h
index 4e6f58c..53704cc 100644
--- a/libclamav/regex_suffix.h
+++ b/libclamav/regex_suffix.h
@@ -1,7 +1,7 @@
 /*
  *  Parse a regular expression, and extract a static suffix.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/rtf.c b/libclamav/rtf.c
index 84987ec..75e8549 100644
--- a/libclamav/rtf.c
+++ b/libclamav/rtf.c
@@ -1,7 +1,7 @@
 /*
  *  Extract embedded objects from RTF files.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/rtf.h b/libclamav/rtf.h
index be0e680..dd0b49b 100644
--- a/libclamav/rtf.h
+++ b/libclamav/rtf.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index e15efa8..abcf8d7 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
@@ -276,6 +276,9 @@ static cl_error_t cli_scanrar(const char *filepath, int desc, cli_ctx *ctx)
         if (unrar_ret == UNRAR_EMEM) {
             status = CL_EMEM;
             goto done;
+        } else if (unrar_ret == UNRAR_EOPEN) {
+            status = CL_EOPEN;
+            goto done;
         } else {
             status = CL_EFORMAT;
             goto done;
@@ -1266,7 +1269,7 @@ static int cli_scanbzip(cli_ctx *ctx)
 static int cli_scanbzip(cli_ctx *ctx)
 {
     int ret = CL_CLEAN, fd, rc;
-    unsigned long int size = 0;
+    uint64_t size = 0;
     char *tmpname;
     bz_stream strm;
     size_t off = 0;
@@ -2871,7 +2874,11 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_
                             cli_set_container(ctx, CL_TYPE_RAR, csize);
                             cli_dbgmsg("RAR/RAR-SFX signature found at %u\n", (unsigned int)fpt->offset);
 
-                            if ((ctx->sub_filepath == NULL) || (fpt->offset != 0)) {
+#ifdef _WIN32
+                            if ((fpt->offset != 0) || (SCAN_UNPRIVILEGED) || (NULL == ctx->sub_filepath) || (0 != _access_s(ctx->sub_filepath, R_OK))) {
+#else
+                            if ((fpt->offset != 0) || (SCAN_UNPRIVILEGED) || (NULL == ctx->sub_filepath) || (0 != access(ctx->sub_filepath, R_OK))) {
+#endif
                                 /*
                                  * If map is not file-backed, or offset is not at the start of the file...
                                  * ...have to dump to file for scanrar.
@@ -2894,6 +2901,25 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_
                             /* scan file */
                             nret = cli_scanrar(filepath, fd, ctx);
 
+                            if ((NULL == tmpname) && (CL_EOPEN == nret)) {
+                                /*
+                                 * Failed to open the file using the original filename.
+                                 * Try writing the file descriptor to a temp file and try again.
+                                 */
+                                nret = fmap_dump_to_file(map, ctx->sub_filepath, ctx->engine->tmpdir, &tmpname, &tmpfd, fpt->offset, fpt->offset + csize);
+                                if (nret != CL_SUCCESS) {
+                                    cli_dbgmsg("cli_scanraw: failed to generate temporary file.\n");
+                                    ret        = nret;
+                                    break_loop = 1;
+                                    break;
+                                }
+                                filepath = tmpname;
+                                fd       = tmpfd;
+
+                                /* try to scan again */
+                                nret = cli_scanrar(filepath, fd, ctx);
+                            }
+
                             if (tmpfd != -1) {
                                 /* If dumped tempfile, need to cleanup */
                                 close(tmpfd);
@@ -3082,7 +3108,7 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_
                         cli_warnmsg("cli_scanraw: Type %u not handled in fpt loop\n", fpt->type);
                 }
 
-            if (nret == CL_VIRUS || break_loop)
+            if (nret == CL_VIRUS || nret == CL_EMEM || break_loop)
                 break;
 
             fpt = fpt->next;
@@ -3467,7 +3493,8 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
     }
 
     if (type != CL_TYPE_IGNORED && ctx->engine->sdb) {
-        if ((ret = cli_scanraw(ctx, type, 0, &dettype, (ctx->engine->engine_options & ENGINE_OPTIONS_DISABLE_CACHE) ? NULL : hash)) == CL_VIRUS) {
+        ret = cli_scanraw(ctx, type, 0, &dettype, (ctx->engine->engine_options & ENGINE_OPTIONS_DISABLE_CACHE) ? NULL : hash);
+        if (ret == CL_EMEM || ret == CL_VIRUS) {
             ret = cli_checkfp(hash, hashed_size, ctx);
             cli_bitset_free(ctx->hook_lsig_matches);
             ctx->hook_lsig_matches = old_hook_lsig_matches;
@@ -3475,6 +3502,7 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
         }
     }
 
+
     ctx->recursion++;
     perf_nested_start(ctx, PERFT_CONTAINER, PERFT_SCAN);
     /* set current level as container AFTER recursing */
@@ -3521,7 +3549,11 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
                 char *tmpname = NULL;
                 int tmpfd     = -1;
 
-                if (ctx->sub_filepath == NULL) {
+#ifdef _WIN32
+                if ((SCAN_UNPRIVILEGED) || (NULL == ctx->sub_filepath) || (0 != _access_s(ctx->sub_filepath, R_OK))) {
+#else
+                if ((SCAN_UNPRIVILEGED) || (NULL == ctx->sub_filepath) || (0 != access(ctx->sub_filepath, R_OK))) {
+#endif
                     /* If map is not file-backed have to dump to file for scanrar. */
                     ret = fmap_dump_to_file(*ctx->fmap, ctx->sub_filepath, ctx->engine->tmpdir, &tmpname, &tmpfd, 0, SIZE_MAX);
                     if (ret != CL_SUCCESS) {
@@ -3539,6 +3571,23 @@ static int magic_scandesc(cli_ctx *ctx, cli_file_t type)
                 /* scan file */
                 ret = cli_scanrar(filepath, fd, ctx);
 
+                if ((NULL == tmpname) && (CL_EOPEN == ret)) {
+                    /*
+                     * Failed to open the file using the original filename.
+                     * Try writing the file descriptor to a temp file and try again.
+                     */
+                    ret = fmap_dump_to_file(*ctx->fmap, ctx->sub_filepath, ctx->engine->tmpdir, &tmpname, &tmpfd, 0, SIZE_MAX);
+                    if (ret != CL_SUCCESS) {
+                        cli_dbgmsg("cli_scanraw: failed to generate temporary file.\n");
+                        break;
+                    }
+                    filepath = tmpname;
+                    fd       = tmpfd;
+
+                    /* try to scan again */
+                    ret = cli_scanrar(filepath, fd, ctx);
+                }
+
                 if (tmpfd != -1) {
                     /* If dumped tempfile, need to cleanup */
                     close(tmpfd);
@@ -4265,17 +4314,7 @@ static cl_error_t scan_common(int desc, cl_fmap_t *map, const char *filepath, co
         }
     }
 
-    /* Best effort to determine the filename if not provided.
-     * May still be NULL if filename could not be determined. */
-    if (filepath == NULL) {
-        char *fpath = NULL;
-
-        if (desc >= 0) {
-            (void)cli_get_filepath_from_filedesc(desc, &fpath);
-        }
-
-        ctx.target_filepath = fpath;
-    } else {
+    if (filepath != NULL) {
         ctx.target_filepath = strdup(filepath);
     }
 
diff --git a/libclamav/scanners.h b/libclamav/scanners.h
index 0314697..f8d098a 100644
--- a/libclamav/scanners.h
+++ b/libclamav/scanners.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/libclamav/sf_base64decode.c b/libclamav/sf_base64decode.c
index eee94ed..0f31509 100644
--- a/libclamav/sf_base64decode.c
+++ b/libclamav/sf_base64decode.c
@@ -1,5 +1,5 @@
 /*
- ** Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ ** Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  ** Copyright (C) 1998-2013 Sourcefire, Inc.
  **
  ** Written by Patrick Mullen <pmullen@sourcefire.com>
diff --git a/libclamav/sf_base64decode.h b/libclamav/sf_base64decode.h
index b25213a..014e955 100644
--- a/libclamav/sf_base64decode.h
+++ b/libclamav/sf_base64decode.h
@@ -1,5 +1,5 @@
 /*
- ** Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ ** Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  ** Copyright (C) 1998-2013 Sourcefire, Inc.
  **
  ** Written by Patrick Mullen <pmullen@sourcefire.com>
diff --git a/libclamav/sis.c b/libclamav/sis.c
index 9fc3fa3..030d7ce 100644
--- a/libclamav/sis.c
+++ b/libclamav/sis.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/sis.h b/libclamav/sis.h
index 9793d01..3069fb7 100644
--- a/libclamav/sis.h
+++ b/libclamav/sis.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/special.c b/libclamav/special.c
index 95997d7..fd0ee0a 100644
--- a/libclamav/special.c
+++ b/libclamav/special.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog, Török Edvin
diff --git a/libclamav/special.h b/libclamav/special.h
index c60afd9..aab26cd 100644
--- a/libclamav/special.h
+++ b/libclamav/special.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog
diff --git a/libclamav/spin.c b/libclamav/spin.c
index d3ee2d8..fd692a7 100644
--- a/libclamav/spin.c
+++ b/libclamav/spin.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/spin.h b/libclamav/spin.h
index 99bf760..7d2615b 100644
--- a/libclamav/spin.h
+++ b/libclamav/spin.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/str.c b/libclamav/str.c
index 62e307e..161e9ee 100644
--- a/libclamav/str.c
+++ b/libclamav/str.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm, Nigel Horne, Török Edvin
diff --git a/libclamav/str.h b/libclamav/str.h
index 665d630..e366ada 100644
--- a/libclamav/str.h
+++ b/libclamav/str.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm, Nigel Horne, Török Edvin
diff --git a/libclamav/swf.c b/libclamav/swf.c
index d14c313..ec3df79 100644
--- a/libclamav/swf.c
+++ b/libclamav/swf.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2011-2013 Sourcefire, Inc.
  *
  *  The code is based on Flasm, command line assembler & disassembler of Flash
diff --git a/libclamav/swf.h b/libclamav/swf.h
index 7c5252d..776f130 100644
--- a/libclamav/swf.h
+++ b/libclamav/swf.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2011-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm <tkojm@clamav.net>
diff --git a/libclamav/table.c b/libclamav/table.c
index 64b846a..cb2b681 100644
--- a/libclamav/table.c
+++ b/libclamav/table.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/table.h b/libclamav/table.h
index 6c09466..59f2883 100644
--- a/libclamav/table.h
+++ b/libclamav/table.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/text.c b/libclamav/text.c
index d3ec9c5..2cbcfe2 100644
--- a/libclamav/text.c
+++ b/libclamav/text.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/text.h b/libclamav/text.h
index 332e42d..022040e 100644
--- a/libclamav/text.h
+++ b/libclamav/text.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/textdet.c b/libclamav/textdet.c
index 4d324f1..f3c20e7 100644
--- a/libclamav/textdet.c
+++ b/libclamav/textdet.c
@@ -1,7 +1,7 @@
 /*
  * Text detection based on ascmagic.c from the file(1) utility.
  *
- * Portions Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Portions Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Portions Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  * Copyright (c) Ian F. Darwin 1986-1995.
diff --git a/libclamav/textdet.h b/libclamav/textdet.h
index 3eab4c2..0852823 100644
--- a/libclamav/textdet.h
+++ b/libclamav/textdet.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
diff --git a/libclamav/textnorm.c b/libclamav/textnorm.c
index 7036e59..bf623bd 100644
--- a/libclamav/textnorm.c
+++ b/libclamav/textnorm.c
@@ -1,7 +1,7 @@
 /*
  *  Generic text normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/textnorm.h b/libclamav/textnorm.h
index e12057e..4619e3f 100644
--- a/libclamav/textnorm.h
+++ b/libclamav/textnorm.h
@@ -1,7 +1,7 @@
 /*
  *  Generic text normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/tiff.c b/libclamav/tiff.c
index 7688ff9..d749a67 100644
--- a/libclamav/tiff.c
+++ b/libclamav/tiff.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2015-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <kevlin2@cisco.com>
  *
diff --git a/libclamav/tiff.h b/libclamav/tiff.h
index 0b40c6c..9d338fe 100644
--- a/libclamav/tiff.h
+++ b/libclamav/tiff.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2015-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Kevin Lin <kevlin2@cisco.com>
  *
diff --git a/libclamav/tnef.c b/libclamav/tnef.c
index acb38db..1ae01fe 100644
--- a/libclamav/tnef.c
+++ b/libclamav/tnef.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/tnef.h b/libclamav/tnef.h
index 36ac302..24f094d 100644
--- a/libclamav/tnef.h
+++ b/libclamav/tnef.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/type_desc.h b/libclamav/type_desc.h
index 28bd625..e338fe0 100644
--- a/libclamav/type_desc.h
+++ b/libclamav/type_desc.h
@@ -1,7 +1,7 @@
 /*
  *  ClamAV bytecode internal API
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/libclamav/unarj.c b/libclamav/unarj.c
index c8e1bb2..025770f 100644
--- a/libclamav/unarj.c
+++ b/libclamav/unarj.c
@@ -1,7 +1,7 @@
 /*
  *  Extract component parts of ARJ archives.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog
@@ -39,6 +39,7 @@
 #include "clamav.h"
 #include "others.h"
 #include "unarj.h"
+#include "textnorm.h"
 
 #define FIRST_HDR_SIZE 30
 #define COMMENT_MAX 2048
@@ -832,8 +833,13 @@ static int arj_read_main_header(arj_metadata_t *metadata)
 {
     uint16_t header_size, count;
     arj_main_hdr_t main_hdr;
-    const char *filename, *comment;
+    const char *filename = NULL;
+    const char *comment = NULL;
     off_t header_offset;
+    struct text_norm_state fnstate, comstate;
+    unsigned char *fnnorm = NULL;
+    unsigned char *comnorm = NULL;
+    uint32_t ret = TRUE;
 
     if (fmap_readn(metadata->map, &header_size, metadata->offset, 2) != 2)
         return FALSE;
@@ -844,14 +850,18 @@ static int arj_read_main_header(arj_metadata_t *metadata)
     cli_dbgmsg("Header Size: %d\n", header_size);
     if (header_size == 0) {
         /* End of archive */
-        return FALSE;
+        ret = FALSE;
+        goto done;
     }
     if (header_size > HEADERSIZE_MAX) {
         cli_dbgmsg("arj_read_header: invalid header_size: %u\n ", header_size);
-        return FALSE;
+        ret = FALSE;
+        goto done;
+    }
+    if (fmap_readn(metadata->map, &main_hdr, metadata->offset, 30) != 30) {
+        ret = FALSE;
+        goto done;
     }
-    if (fmap_readn(metadata->map, &main_hdr, metadata->offset, 30) != 30)
-        return FALSE;
     metadata->offset += 30;
 
     cli_dbgmsg("ARJ Main File Header\n");
@@ -865,34 +875,48 @@ static int arj_read_main_header(arj_metadata_t *metadata)
 
     if (main_hdr.first_hdr_size < 30) {
         cli_dbgmsg("Format error. First Header Size < 30\n");
-        return FALSE;
+        ret = FALSE;
+        goto done;
     }
     if (main_hdr.first_hdr_size > 30) {
         metadata->offset += main_hdr.first_hdr_size - 30;
     }
 
+    fnnorm = cli_calloc(sizeof(unsigned char), header_size + 1);
     filename = fmap_need_offstr(metadata->map, metadata->offset, header_size);
     if (!filename) {
         cli_dbgmsg("UNARJ: Unable to allocate memory for filename\n");
-        return FALSE;
+        ret = FALSE;
+        goto done;
     }
-    metadata->offset += strlen(filename) + 1;
+    metadata->offset += CLI_STRNLEN(filename, header_size) + 1;
 
+    comnorm = cli_calloc(sizeof(unsigned char), header_size + 1);
     comment = fmap_need_offstr(metadata->map, metadata->offset, header_size);
-    if (!comment) {
+    if (!comment || !comnorm) {
         cli_dbgmsg("UNARJ: Unable to allocate memory for comment\n");
-        return FALSE;
+        ret = FALSE;
+        goto done;
     }
-    metadata->offset += strlen(comment) + 1;
-    cli_dbgmsg("Filename: %s\n", filename);
-    cli_dbgmsg("Comment: %s\n", comment);
+    metadata->offset += CLI_STRNLEN(comment, header_size) + 1;
+
+    text_normalize_init(&fnstate, fnnorm, header_size);
+    text_normalize_init(&comstate, comnorm, header_size);
+
+    text_normalize_buffer(&fnstate, filename, metadata->offset);
+    text_normalize_buffer(&comstate, comment, metadata->offset);
+
+    cli_dbgmsg("Filename: %s\n", fnnorm);
+    cli_dbgmsg("Comment: %s\n", comnorm);
 
     metadata->offset += 4; /* crc */
     /* Skip past any extended header data */
     for (;;) {
         const uint16_t *countp = fmap_need_off_once(metadata->map, metadata->offset, 2);
-        if (!countp)
-            return FALSE;
+        if (!countp) {
+            ret = FALSE;
+            goto done;
+        }
         count = cli_readint16(countp);
         metadata->offset += 2;
         cli_dbgmsg("Extended header size: %d\n", count);
@@ -902,7 +926,19 @@ static int arj_read_main_header(arj_metadata_t *metadata)
         /* Skip extended header + 4byte CRC */
         metadata->offset += count + 4;
     }
-    return TRUE;
+
+done:
+
+    if (fnnorm) {
+        free(fnnorm);
+        fnnorm = NULL;
+    }
+
+    if (comnorm) {
+        free(comnorm);
+        comnorm = NULL;
+    }
+    return ret;
 }
 
 static int arj_read_file_header(arj_metadata_t *metadata)
@@ -910,6 +946,10 @@ static int arj_read_file_header(arj_metadata_t *metadata)
     uint16_t header_size, count;
     const char *filename, *comment;
     arj_file_hdr_t file_hdr;
+    struct text_norm_state fnstate, comstate;
+    unsigned char *fnnorm = NULL;
+    unsigned char *comnorm = NULL;
+    uint32_t ret = CL_SUCCESS;
 
     if (fmap_readn(metadata->map, &header_size, metadata->offset, 2) != 2)
         return CL_EFORMAT;
@@ -919,15 +959,18 @@ static int arj_read_file_header(arj_metadata_t *metadata)
     cli_dbgmsg("Header Size: %d\n", header_size);
     if (header_size == 0) {
         /* End of archive */
-        return CL_BREAK;
+        ret = CL_BREAK;
+        goto done;
     }
     if (header_size > HEADERSIZE_MAX) {
         cli_dbgmsg("arj_read_file_header: invalid header_size: %u\n ", header_size);
-        return CL_EFORMAT;
+        ret = CL_EFORMAT;
+        goto done;
     }
 
     if (fmap_readn(metadata->map, &file_hdr, metadata->offset, 30) != 30) {
-        return CL_EFORMAT;
+        ret = CL_EFORMAT;
+        goto done;
     }
     metadata->offset += 30;
     file_hdr.comp_size = le32_to_host(file_hdr.comp_size);
@@ -947,7 +990,8 @@ static int arj_read_file_header(arj_metadata_t *metadata)
 
     if (file_hdr.first_hdr_size < 30) {
         cli_dbgmsg("Format error. First Header Size < 30\n");
-        return CL_EFORMAT;
+        ret = CL_EFORMAT;
+        goto done;
     }
 
     /* Note: this skips past any extended file start position data (multi-volume) */
@@ -955,22 +999,33 @@ static int arj_read_file_header(arj_metadata_t *metadata)
         metadata->offset += file_hdr.first_hdr_size - 30;
     }
 
+    fnnorm = cli_calloc(sizeof(unsigned char), header_size + 1);
     filename = fmap_need_offstr(metadata->map, metadata->offset, header_size);
     if (!filename) {
         cli_dbgmsg("UNARJ: Unable to allocate memory for filename\n");
-        return FALSE;
+        ret = FALSE;
+        goto done;
     }
-    metadata->offset += strlen(filename) + 1;
+    metadata->offset += CLI_STRNLEN(filename, header_size) + 1;
 
+    comnorm = cli_calloc(sizeof(unsigned char), header_size + 1);
     comment = fmap_need_offstr(metadata->map, metadata->offset, header_size);
     if (!comment) {
         cli_dbgmsg("UNARJ: Unable to allocate memory for comment\n");
-        return FALSE;
+        ret = FALSE;
+        goto done;
     }
-    metadata->offset += strlen(comment) + 1;
-    cli_dbgmsg("Filename: %s\n", filename);
-    cli_dbgmsg("Comment: %s\n", comment);
-    metadata->filename = cli_strdup(filename);
+    metadata->offset += CLI_STRNLEN(comment, header_size) + 1;
+
+    text_normalize_init(&fnstate, fnnorm, header_size);
+    text_normalize_init(&comstate, comnorm, header_size);
+
+    text_normalize_buffer(&fnstate, filename, metadata->offset);
+    text_normalize_buffer(&comstate, comment, metadata->offset);
+
+    cli_dbgmsg("Filename: %s\n", fnnorm);
+    cli_dbgmsg("Comment: %s\n", comnorm);
+    metadata->filename = CLI_STRNDUP(filename, header_size);
 
     /* Skip CRC */
     metadata->offset += 4;
@@ -982,7 +1037,8 @@ static int arj_read_file_header(arj_metadata_t *metadata)
             if (metadata->filename)
                 free(metadata->filename);
             metadata->filename = NULL;
-            return CL_EFORMAT;
+            ret = CL_EFORMAT;
+            goto done;
         }
         count = cli_readint16(countp);
         metadata->offset += 2;
@@ -999,10 +1055,22 @@ static int arj_read_file_header(arj_metadata_t *metadata)
     metadata->encrypted = ((file_hdr.flags & GARBLE_FLAG) != 0) ? TRUE : FALSE;
     metadata->ofd       = -1;
     if (!metadata->filename) {
-        return CL_EMEM;
+        ret =  CL_EMEM;
+        goto done;
     }
 
-    return CL_SUCCESS;
+    done:
+
+    if (fnnorm) {
+        free(fnnorm);
+        fnnorm = NULL;
+    }
+
+    if (comnorm) {
+        free(comnorm);
+        comnorm = NULL;
+    }
+    return ret;
 }
 
 int cli_unarj_open(fmap_t *map, const char *dirname, arj_metadata_t *metadata, size_t off)
diff --git a/libclamav/unarj.h b/libclamav/unarj.h
index f312fd4..a2777d8 100644
--- a/libclamav/unarj.h
+++ b/libclamav/unarj.h
@@ -1,7 +1,7 @@
 /*
  *  Extract component parts of ARJ archives
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/uniq.c b/libclamav/uniq.c
index 19987f2..850be3a 100644
--- a/libclamav/uniq.c
+++ b/libclamav/uniq.c
@@ -1,7 +1,7 @@
 /*
  *  md5 based hashtab
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/uniq.h b/libclamav/uniq.h
index 72495ab..5acf6c0 100644
--- a/libclamav/uniq.h
+++ b/libclamav/uniq.h
@@ -1,7 +1,7 @@
 /*
  *  md5 based hashtab
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
diff --git a/libclamav/unsp.c b/libclamav/unsp.c
index ebacc40..49d5cc9 100644
--- a/libclamav/unsp.c
+++ b/libclamav/unsp.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/unsp.h b/libclamav/unsp.h
index c24e0f9..67d8644 100644
--- a/libclamav/unsp.h
+++ b/libclamav/unsp.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/untar.c b/libclamav/untar.c
index 1becf42..886226d 100644
--- a/libclamav/untar.c
+++ b/libclamav/untar.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/untar.h b/libclamav/untar.h
index cb008e2..d5b7d9d 100644
--- a/libclamav/untar.h
+++ b/libclamav/untar.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/unzip.c b/libclamav/unzip.c
index 7b8cff5..33a5037 100644
--- a/libclamav/unzip.c
+++ b/libclamav/unzip.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/unzip.h b/libclamav/unzip.h
index 927113c..3315880 100644
--- a/libclamav/unzip.h
+++ b/libclamav/unzip.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/upack.c b/libclamav/upack.c
index 3ef5d3b..4cf7bb3 100644
--- a/libclamav/upack.c
+++ b/libclamav/upack.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Michal 'GiM' Spadlinski
diff --git a/libclamav/upack.h b/libclamav/upack.h
index bcc8dd8..16bf8c3 100644
--- a/libclamav/upack.h
+++ b/libclamav/upack.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Michal 'GiM' Spadlinski
diff --git a/libclamav/upx.c b/libclamav/upx.c
index 8b1c639..4ebf408 100644
--- a/libclamav/upx.c
+++ b/libclamav/upx.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/upx.h b/libclamav/upx.h
index 87ac06d..afd651a 100644
--- a/libclamav/upx.h
+++ b/libclamav/upx.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/uuencode.c b/libclamav/uuencode.c
index ba839f5..eec98b8 100644
--- a/libclamav/uuencode.c
+++ b/libclamav/uuencode.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/uuencode.h b/libclamav/uuencode.h
index b0dd149..69c98a4 100644
--- a/libclamav/uuencode.h
+++ b/libclamav/uuencode.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Nigel Horne
diff --git a/libclamav/vba_extract.c b/libclamav/vba_extract.c
index 8bd2e1f..15727da 100644
--- a/libclamav/vba_extract.c
+++ b/libclamav/vba_extract.c
@@ -1,7 +1,7 @@
 /*
  *  Extract VBA source code for component MS Office Documents
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog, Nigel Horne
diff --git a/libclamav/vba_extract.h b/libclamav/vba_extract.h
index b99fa08..79c06ee 100644
--- a/libclamav/vba_extract.h
+++ b/libclamav/vba_extract.h
@@ -1,7 +1,7 @@
 /*
  *  Extract VBA source code for component MS Office Documents
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Trog, Nigel Horne
diff --git a/libclamav/wwunpack.c b/libclamav/wwunpack.c
index 2f49780..7fd53d0 100644
--- a/libclamav/wwunpack.c
+++ b/libclamav/wwunpack.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/wwunpack.h b/libclamav/wwunpack.h
index 93b475c..681ad51 100644
--- a/libclamav/wwunpack.h
+++ b/libclamav/wwunpack.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamav/xar.c b/libclamav/xar.c
index d12091d..a0519ef 100644
--- a/libclamav/xar.c
+++ b/libclamav/xar.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: Steven Morgan <smorgan@sourcefire.com>
diff --git a/libclamav/xar.h b/libclamav/xar.h
index 40719bb..70967f1 100644
--- a/libclamav/xar.h
+++ b/libclamav/xar.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: David Raynor <draynor@sourcefire.com>
diff --git a/libclamav/xz_iface.c b/libclamav/xz_iface.c
index e47ac73..75a05b4 100644
--- a/libclamav/xz_iface.c
+++ b/libclamav/xz_iface.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: Steven Morgan (smorgan@sourcefire.com)
diff --git a/libclamav/xz_iface.h b/libclamav/xz_iface.h
index 107d3ea..e7ab720 100644
--- a/libclamav/xz_iface.h
+++ b/libclamav/xz_iface.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: Steven Morgan (smorgan@sourcefire.com)
diff --git a/libclamav/yara_clam.h b/libclamav/yara_clam.h
index d46918a..0526c89 100644
--- a/libclamav/yara_clam.h
+++ b/libclamav/yara_clam.h
@@ -1,7 +1,7 @@
 /*
  * Main YARA header file for ClamAV
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Steven Morgan
  *
diff --git a/libclamav/yara_grammar.y b/libclamav/yara_grammar.y
index d236ec2..ce96136 100644
--- a/libclamav/yara_grammar.y
+++ b/libclamav/yara_grammar.y
@@ -1,7 +1,7 @@
 /*
  * YARA rule parser for ClamAV
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Steven Morgan
  *
diff --git a/libclamav/yara_lexer.c b/libclamav/yara_lexer.c
index 082a9cd..4c60219 100644
--- a/libclamav/yara_lexer.c
+++ b/libclamav/yara_lexer.c
@@ -624,7 +624,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[76] =
 /*
  * YARA rule lexer for ClamAV
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Steven Morgan
  *
diff --git a/libclamav/yara_lexer.l b/libclamav/yara_lexer.l
index 54b83da..39f83cd 100644
--- a/libclamav/yara_lexer.l
+++ b/libclamav/yara_lexer.l
@@ -1,7 +1,7 @@
 /*
  * YARA rule lexer for ClamAV
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Steven Morgan
  *
diff --git a/libclamav/yara_parser.c b/libclamav/yara_parser.c
index b52392d..c5deb4a 100644
--- a/libclamav/yara_parser.c
+++ b/libclamav/yara_parser.c
@@ -1,7 +1,7 @@
 /*
  * YARA parser for ClamAV: back-end functions
  *
- * Copyright (C) 2014-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2014-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  * Authors: Steven Morgan
  *
diff --git a/libclamav/yc.c b/libclamav/yc.c
index 8bb8a29..9668793 100644
--- a/libclamav/yc.c
+++ b/libclamav/yc.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Ivan Zlatev
diff --git a/libclamav/yc.h b/libclamav/yc.h
index 97166da..ad62328 100644
--- a/libclamav/yc.h
+++ b/libclamav/yc.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Alberto Wu
diff --git a/libclamunrar_iface/unrar_iface.cpp b/libclamunrar_iface/unrar_iface.cpp
index 7a2cef8..358207a 100644
--- a/libclamunrar_iface/unrar_iface.cpp
+++ b/libclamunrar_iface/unrar_iface.cpp
@@ -1,7 +1,7 @@
 /*
  * Interface to libclamunrar
  *
- * Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  * Authors: Trog, Torok Edvin, Tomasz Kojm, Micah Snyder
@@ -135,6 +135,7 @@ static cl_unrar_error_t unrar_retcode(int retcode)
         }
         case ERAR_EOPEN: {
             unrar_dbgmsg("unrar_retcode: Volume open error.\n");
+            status = UNRAR_EOPEN;
             break;
         }
         case ERAR_ECREATE: {
diff --git a/libclamunrar_iface/unrar_iface.h b/libclamunrar_iface/unrar_iface.h
index 594bf25..d226913 100644
--- a/libclamunrar_iface/unrar_iface.h
+++ b/libclamunrar_iface/unrar_iface.h
@@ -1,7 +1,7 @@
 /*
  * Interface to libclamunrar
  *
- * Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ * Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  * Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  * Authors: Trog, Torok Edvin, Tomasz Kojm, Micah Snyder
@@ -50,7 +50,8 @@ typedef enum cl_unrar_error_tag {
     UNRAR_BREAK,
     UNRAR_ENCRYPTED,
     UNRAR_EMEM,
-    UNRAR_ERR
+    UNRAR_ERR,
+    UNRAR_EOPEN
 } cl_unrar_error_t;
 
 typedef struct unrar_metadata_tag {
diff --git a/libfreshclam/Makefile.am b/libfreshclam/Makefile.am
index b76ae67..778605c 100644
--- a/libfreshclam/Makefile.am
+++ b/libfreshclam/Makefile.am
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2015-2019 Cisco Systems
+#  Copyright (C) 2015-2020 Cisco Systems
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
diff --git a/libfreshclam/Makefile.in b/libfreshclam/Makefile.in
index 82e6ea5..6f3b63d 100644
--- a/libfreshclam/Makefile.in
+++ b/libfreshclam/Makefile.in
@@ -15,7 +15,7 @@
 @SET_MAKE@
 
 #
-#  Copyright (C) 2015-2019 Cisco Systems
+#  Copyright (C) 2015-2020 Cisco Systems
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
diff --git a/libfreshclam/dns.c b/libfreshclam/dns.c
index 2cee780..67d3f82 100644
--- a/libfreshclam/dns.c
+++ b/libfreshclam/dns.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2004-2007 Tomasz Kojm <tkojm@clamav.net>2004 Tomasz Kojm <tkojm@clamav.net>
  *
diff --git a/libfreshclam/dns.h b/libfreshclam/dns.h
index 1f9c56a..ee14efb 100644
--- a/libfreshclam/dns.h
+++ b/libfreshclam/dns.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2004-2007 Tomasz Kojm <tkojm@clamav.net>
  *
diff --git a/libfreshclam/libfreshclam.c b/libfreshclam/libfreshclam.c
index 8457787..c32646c 100644
--- a/libfreshclam/libfreshclam.c
+++ b/libfreshclam/libfreshclam.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
@@ -235,17 +235,6 @@ fc_error_t fc_initialize(fc_config *fcConfig)
         goto done;
     }
 
-    /* Validate that the temp directory exists, and store it. */
-    if (LSTAT(fcConfig->tempDirectory, &statbuf) == -1) {
-        logg("!Temp directory does not exist: %s\n", fcConfig->tempDirectory);
-        status = FC_EDIRECTORY;
-        goto done;
-    }
-    if (!S_ISDIR(statbuf.st_mode)) {
-        logg("!Temp directory is not a directory: %s\n", fcConfig->tempDirectory);
-        status = FC_EDIRECTORY;
-        goto done;
-    }
     g_tempDirectory = cli_strdup(fcConfig->tempDirectory);
 
     g_maxAttempts    = fcConfig->maxAttempts;
diff --git a/libfreshclam/libfreshclam.h b/libfreshclam/libfreshclam.h
index b219e09..a83a338 100644
--- a/libfreshclam/libfreshclam.h
+++ b/libfreshclam/libfreshclam.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
diff --git a/libfreshclam/libfreshclam_internal.c b/libfreshclam/libfreshclam_internal.c
index 2de05dc..26cd052 100644
--- a/libfreshclam/libfreshclam_internal.c
+++ b/libfreshclam/libfreshclam_internal.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
@@ -166,7 +166,7 @@ static void printBytes(curl_off_t bytes)
         double megabytes = bytes / (double)(1024 * 1024);
         fprintf(stdout, "%.02fMiB", megabytes);
     } else if (bytes / 1024 > 1) {
-        double kilobytes = bytes / (double)(1024 * 1024);
+        double kilobytes = bytes / (double)(1024);
         fprintf(stdout, "%.02fKiB", kilobytes);
     } else {
         fprintf(stdout, "%" CURL_FORMAT_CURL_OFF_T "B", bytes);
@@ -187,7 +187,7 @@ static int xferinfo(void *prog,
     TIMETYPE remtime               = 0;
 
     uint32_t i                = 0;
-    uint32_t totalNumDots     = 40;
+    uint32_t totalNumDots     = 30;
     uint32_t numDots          = 0;
     double fractiondownloaded = 0.0;
 
@@ -203,11 +203,14 @@ static int xferinfo(void *prog,
     xferProg->lastRunTime = curtime;
     remtime               = (curtime * 1 / fractiondownloaded) - curtime;
 
+#ifndef _WIN32
+    fprintf(stdout, "\e[?7l");
+#endif
 #ifdef TIME_IN_US
     if (fractiondownloaded <= 0.0) {
         fprintf(stdout, "Time: %.1fs ", curtime / 1000000.0);
     } else {
-        fprintf(stdout, "Time: %.1fs, ETA; %.1fs ", curtime / 1000000.0, remtime / 1000000.0);
+        fprintf(stdout, "Time: %.1fs, ETA: %.1fs ", curtime / 1000000.0, remtime / 1000000.0);
     }
 #else
     if (fractiondownloaded <= 0.0) {
@@ -249,11 +252,26 @@ static int xferinfo(void *prog,
         fprintf(stdout, "     \n");
         xferProg->bComplete = 1;
     }
+#ifndef _WIN32
+    fprintf(stdout, "\e[?7h");
+#endif
     fflush(stdout);
 
     return 0;
 }
 
+static void set_tls_ca_bundle(CURL *curl)
+{
+    char *ca_bundle;
+
+    ca_bundle = secure_getenv("CURL_CA_BUNDLE");
+    if (!ca_bundle)
+	    return;
+
+    if (curl_easy_setopt(curl, CURLOPT_CAINFO, ca_bundle) != CURLE_OK)
+	    logg("!set_tls_ca_bundle: Failed to set CURLOPT_CAINFO!\n");
+}
+
 #if LIBCURL_VERSION_NUM < 0x072000
 /**
  * Function from curl example code, Copyright (C) 1998 - 2018, Daniel Stenberg, see COPYING.curl for license details
@@ -339,6 +357,7 @@ static fc_error_t create_curl_handle(
             }
         }
     }
+    set_tls_ca_bundle(curl);
 
 #if (LIBCURL_VERSION_MAJOR > 7) || ((LIBCURL_VERSION_MAJOR == 7) && (LIBCURL_VERSION_MINOR >= 33))
     if (g_localIP) {
@@ -1080,15 +1099,25 @@ static fc_error_t getcvd(
     }
 
     if (cvd->version < remoteVersion) {
-        logg("^Mirror %s is not synchronized.\n", server);
-        if (cvd->version < remoteVersion - 1) {
-            logg("!Downloaded database version is more than 1 version older than the version advertised in DNS TXT record.\n");
+        if (cvd->version == remoteVersion - 1) {
+            logg("*The %s database downloaded from %s is one version older than advertised in the DNS TXT record.\n",
+                cvdfile,
+                server);
+
+            /*
+             * Tolerate an off-by-one version mismatch.
+             * Chances are the new version was just published and the CDN is still updating.
+             */
+            status = FC_SUCCESS;
+            goto done;
+        }
+        else {
+            logg("!The %s database downloaded from %s is more than one version older than the version advertised in the DNS TXT record.\n",
+                cvdfile,
+                server);
             status = FC_EMIRRORNOTSYNC;
             goto done;
         }
-
-        status = FC_UPTODATE;
-        goto done;
     }
 
     status = FC_SUCCESS;
diff --git a/libfreshclam/libfreshclam_internal.h b/libfreshclam/libfreshclam_internal.h
index 353572a..747e3ee 100644
--- a/libfreshclam/libfreshclam_internal.h
+++ b/libfreshclam/libfreshclam_internal.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
diff --git a/m4/reorganization/version.m4 b/m4/reorganization/version.m4
index 225310b..bd128ce 100644
--- a/m4/reorganization/version.m4
+++ b/m4/reorganization/version.m4
@@ -3,7 +3,7 @@ dnl During active development, set: VERSION="<version>-devel-`date +%Y%m%d`"
 dnl For beta,                  set: VERSION="<version>-beta"
 dnl For release candidate,     set: VERSION="<version>-rc"
 dnl For release,               set: VERSION="<version>"
-VERSION="0.102.1"
+VERSION="0.102.2"
 
 major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
 minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
diff --git a/shared/actions.c b/shared/actions.c
index d437c04..e8ff87a 100644
--- a/shared/actions.c
+++ b/shared/actions.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Author: aCaB
diff --git a/shared/actions.h b/shared/actions.h
index acdc6da..91ffb54 100644
--- a/shared/actions.h
+++ b/shared/actions.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB
diff --git a/shared/cert_util.c b/shared/cert_util.c
index 0e1325c..2f825c4 100644
--- a/shared/cert_util.c
+++ b/shared/cert_util.c
@@ -1,7 +1,7 @@
 /*
  *  OpenSSL certificate caching.
  *
- *  Copyright (C) 2016-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2016-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Russ Kubik
  *
diff --git a/shared/cert_util_internal.h b/shared/cert_util_internal.h
index e27a0bd..fc02923 100644
--- a/shared/cert_util_internal.h
+++ b/shared/cert_util_internal.h
@@ -1,7 +1,7 @@
 /*
  *  Internal certificate utility methods and data structures.
  *
- *  Copyright (C) 2016-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2016-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Russ Kubik
  *
diff --git a/shared/clamdcom.c b/shared/clamdcom.c
index 01500cd..11dce51 100644
--- a/shared/clamdcom.c
+++ b/shared/clamdcom.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Author: aCaB
diff --git a/shared/clamdcom.h b/shared/clamdcom.h
index 3b2dcc0..c3d062f 100644
--- a/shared/clamdcom.h
+++ b/shared/clamdcom.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Author: aCaB
diff --git a/shared/fdpassing.h b/shared/fdpassing.h
index d49f331..0e9e78e 100644
--- a/shared/fdpassing.h
+++ b/shared/fdpassing.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
diff --git a/shared/hostid.c b/shared/hostid.c
index ca2b8be..c1ccbd9 100644
--- a/shared/hostid.c
+++ b/shared/hostid.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco and/or its affiliates. All rights reserved.
  *
  *  Author: Shawn Webb
  *
diff --git a/shared/hostid.h b/shared/hostid.h
index 9979385..b0e9ea4 100644
--- a/shared/hostid.h
+++ b/shared/hostid.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2014-2019 Cisco and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2014-2020 Cisco and/or its affiliates. All rights reserved.
  *
  *  Author: Shawn Webb
  *
diff --git a/shared/linux/cert_util_linux.c b/shared/linux/cert_util_linux.c
index a4e347e..47caaf9 100644
--- a/shared/linux/cert_util_linux.c
+++ b/shared/linux/cert_util_linux.c
@@ -1,7 +1,7 @@
 /*
  *  OpenSSL certificate verification for Linux.
  *
- *  Copyright (C) 2016-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2016-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Russ Kubik
  *
diff --git a/shared/mac/cert_util_mac.m b/shared/mac/cert_util_mac.m
index 4ab4f22..a338998 100644
--- a/shared/mac/cert_util_mac.m
+++ b/shared/mac/cert_util_mac.m
@@ -1,7 +1,7 @@
 /*
  *  OpenSSL certificate verification for macOS.
  *
- *  Copyright (C) 2016-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2016-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Russ Kubik
  *
diff --git a/shared/misc.c b/shared/misc.c
index 12ee200..ce3cb3c 100644
--- a/shared/misc.c
+++ b/shared/misc.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/shared/misc.h b/shared/misc.h
index 5e8cbf3..88dc91e 100644
--- a/shared/misc.h
+++ b/shared/misc.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/shared/optparser.c b/shared/optparser.c
index dd1a51d..bb597c7 100644
--- a/shared/optparser.c
+++ b/shared/optparser.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Author: Tomasz Kojm <tkojm@clamav.net>
@@ -496,7 +496,7 @@ const struct clam_option __clam_options[] = {
 
     {"ConnectTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 30, NULL, 0, OPT_FRESHCLAM, "Timeout in seconds when connecting to database server.", "30"},
 
-    {"ReceiveTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 60, NULL, 0, OPT_FRESHCLAM, "Timeout in seconds when reading from database server.", "60"},
+    {"ReceiveTimeout", NULL, 0, CLOPT_TYPE_NUMBER, MATCH_NUMBER, 0, NULL, 0, OPT_FRESHCLAM, "Timeout in seconds when reading from database server.", "0"},
 
     {"SafeBrowsing", NULL, 0, CLOPT_TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_FRESHCLAM, "This option enables support for Google Safe Browsing. When activated for\nthe first time, freshclam will download a new database file (safebrowsing.cvd)\nwhich will be automatically loaded by clamd and clamscan during the next\nreload, provided that the heuristic phishing detection is turned on. This\ndatabase includes information about websites that may be phishing sites or\npossible sources of malware. When using this option, it's mandatory to run\nfreshclam at least every 30 minutes.\nFreshclam uses the ClamAV's mirror infrastructure to distribute the\ndatabase and its updates but all the contents are provided under Google's\nterms of use. See https://transparencyreport.google.com/safe-browsing/overview \n and https://www.clamav.net/documents/safebrowsing for more information.", "yes"},
 
diff --git a/shared/optparser.h b/shared/optparser.h
index 756d5bc..e0b5fb7 100644
--- a/shared/optparser.h
+++ b/shared/optparser.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Author: Tomasz Kojm <tkojm@clamav.net>
diff --git a/shared/output.c b/shared/output.c
index 3ab9a79..430ffe9 100644
--- a/shared/output.c
+++ b/shared/output.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/shared/output.h b/shared/output.h
index 7e40b1b..ead9896 100644
--- a/shared/output.h
+++ b/shared/output.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
diff --git a/shared/tar.c b/shared/tar.c
index 9e2f6df..bc5823b 100644
--- a/shared/tar.c
+++ b/shared/tar.c
@@ -1,7 +1,7 @@
 /*
  *  A minimalistic tar archiver for sigtool and freshclam.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Author: Tomasz Kojm <tkojm@clamav.net>
diff --git a/shared/tar.h b/shared/tar.h
index 7110c25..37f8ca1 100644
--- a/shared/tar.h
+++ b/shared/tar.h
@@ -1,7 +1,7 @@
 /*
  *  A minimalistic tar archiver for sigtool and freshclam.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *
  *  Author: Tomasz Kojm <tkojm@clamav.net>
diff --git a/shared/win/cert_util_win.c b/shared/win/cert_util_win.c
index 7fcd5da..872cbc1 100644
--- a/shared/win/cert_util_win.c
+++ b/shared/win/cert_util_win.c
@@ -1,7 +1,7 @@
 /*
  *  OpenSSL certificate verification for Windows.
  *
- *  Copyright (C) 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2019-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *
  *  Authors: Micah Snyder
  *
diff --git a/sigtool/Makefile.am b/sigtool/Makefile.am
index d0dd61f..453d3bc 100644
--- a/sigtool/Makefile.am
+++ b/sigtool/Makefile.am
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+#  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 #  Copyright (C) 2007-2013 Sourcefire, Inc.
 #  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
 #
diff --git a/sigtool/Makefile.in b/sigtool/Makefile.in
index 48e2801..9d71f0e 100644
--- a/sigtool/Makefile.in
+++ b/sigtool/Makefile.in
@@ -15,7 +15,7 @@
 @SET_MAKE@
 
 #
-#  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+#  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 #  Copyright (C) 2007-2013 Sourcefire, Inc.
 #  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
 #
diff --git a/sigtool/sigtool.c b/sigtool/sigtool.c
index add625d..f0963ed 100644
--- a/sigtool/sigtool.c
+++ b/sigtool/sigtool.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
  *  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
  *
@@ -3498,7 +3498,7 @@ static void help(void)
     mprintf("\n");
     mprintf("                      Clam AntiVirus: Signature Tool %s\n", get_version());
     mprintf("           By The ClamAV Team: https://www.clamav.net/about.html#credits\n";);
-    mprintf("           (C) 2019 Cisco Systems, Inc.\n");
+    mprintf("           (C) 2020 Cisco Systems, Inc.\n");
     mprintf("\n");
     mprintf("    sigtool [options]\n");
     mprintf("\n");
diff --git a/unit_tests/check_bytecode.c b/unit_tests/check_bytecode.c
index f56f94b..c2df6c5 100644
--- a/unit_tests/check_bytecode.c
+++ b/unit_tests/check_bytecode.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for bytecode functions.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -71,21 +71,21 @@ static void runtest(const char *file, uint64_t expected, int fail, int nojit,
     cctx.options->general |= CL_SCAN_GENERAL_ALLMATCHES;
     cctx.virname = &virname;
     cctx.engine = engine = cl_engine_new();
-    fail_unless(!!cctx.engine, "cannot create engine");
+    ck_assert_msg(!!cctx.engine, "cannot create engine");
     rc = cl_engine_compile(engine);
-    fail_unless(!rc, "cannot compile engine");
+    ck_assert_msg(!rc, "cannot compile engine");
     cctx.fmap = cli_calloc(sizeof(fmap_t *), engine->maxreclevel + 2);
-    fail_unless(!!cctx.fmap, "cannot allocate fmap");
+    ck_assert_msg(!!cctx.fmap, "cannot allocate fmap");
 
-    fail_unless(fd >= 0, "retmagic open failed");
+    ck_assert_msg(fd >= 0, "retmagic open failed");
     f = fdopen(fd, "r");
-    fail_unless(!!f, "retmagic fdopen failed");
+    ck_assert_msg(!!f, "retmagic fdopen failed");
 
     cl_debug();
 
     if (!nojit) {
         rc = cli_bytecode_init(&bcs);
-        fail_unless(rc == CL_SUCCESS, "cli_bytecode_init failed");
+        ck_assert_msg(rc == CL_SUCCESS, "cli_bytecode_init failed");
     } else {
         bcs.engine = NULL;
     }
@@ -94,22 +94,22 @@ static void runtest(const char *file, uint64_t expected, int fail, int nojit,
     bcs.count   = 1;
 
     rc = cli_bytecode_load(&bc, f, NULL, 1, 0);
-    fail_unless(rc == CL_SUCCESS, "cli_bytecode_load failed");
+    ck_assert_msg(rc == CL_SUCCESS, "cli_bytecode_load failed");
     fclose(f);
 
     if (testmode && have_clamjit)
         engine->bytecode_mode = CL_BYTECODE_MODE_TEST;
 
     rc = cli_bytecode_prepare2(engine, &bcs, BYTECODE_ENGINE_MASK);
-    fail_unless(rc == CL_SUCCESS, "cli_bytecode_prepare failed");
+    ck_assert_msg(rc == CL_SUCCESS, "cli_bytecode_prepare failed");
 
     if (have_clamjit && !nojit && nojit != -1 && !testmode) {
-        fail_unless(bc.state == bc_jit, "preparing for JIT failed");
+        ck_assert_msg(bc.state == bc_jit, "preparing for JIT failed");
     }
 
     ctx                   = cli_bytecode_context_alloc();
     ctx->bytecode_timeout = fail == CL_ETIMEOUT ? 10 : 10000;
-    fail_unless(!!ctx, "cli_bytecode_context_alloc failed");
+    ck_assert_msg(!!ctx, "cli_bytecode_context_alloc failed");
 
     ctx->ctx = &cctx;
     if (infile) {
@@ -117,9 +117,9 @@ static void runtest(const char *file, uint64_t expected, int fail, int nojit,
         fdin = open(filestr, O_RDONLY);
         if (fdin < 0 && errno == ENOENT)
             fdin = open_testfile(infile);
-        fail_unless(fdin >= 0, "failed to open infile");
+        ck_assert_msg(fdin >= 0, "failed to open infile");
         map = fmap(fdin, 0, 0);
-        fail_unless(!!map, "unable to fmap infile");
+        ck_assert_msg(!!map, "unable to fmap infile");
         if (pedata)
             ctx->hooks.pedata = pedata;
         ctx->sections = sections;
@@ -128,16 +128,16 @@ static void runtest(const char *file, uint64_t expected, int fail, int nojit,
 
     cli_bytecode_context_setfuncid(ctx, &bc, 0);
     rc = cli_bytecode_run(&bcs, &bc, ctx);
-    fail_unless_fmt(rc == fail, "cli_bytecode_run failed, expected: %u, have: %u\n",
+    ck_assert_msg(rc == fail, "cli_bytecode_run failed, expected: %u, have: %u\n",
                     fail, rc);
 
     if (rc == CL_SUCCESS) {
         v = cli_bytecode_context_getresult_int(ctx);
-        fail_unless_fmt(v == expected, "Invalid return value from bytecode run, expected: %llx, have: %llx\n",
+        ck_assert_msg(v == expected, "Invalid return value from bytecode run, expected: %llx, have: %llx\n",
                         expected, v);
     }
     if (infile && expectedvirname) {
-        fail_unless(ctx->virname &&
+        ck_assert_msg(ctx->virname &&
                         !strcmp(ctx->virname, expectedvirname),
                     "Invalid virname, expected: %s\n", expectedvirname);
     }
@@ -489,18 +489,18 @@ static void runload(const char *dbname, struct cl_engine *engine, unsigned signo
         srcdir = SRCDIR;
     }
     str = cli_malloc(strlen(dbname) + strlen(srcdir) + 2);
-    fail_unless(!!str, "cli_malloc");
+    ck_assert_msg(!!str, "cli_malloc");
     sprintf(str, "%s/%s", srcdir, dbname);
 
     rc = cl_load(str, engine, &signo, CL_DB_STDOPT);
-    fail_unless_fmt(rc == CL_SUCCESS, "failed to load %s: %s\n",
+    ck_assert_msg(rc == CL_SUCCESS, "failed to load %s: %s\n",
                     dbname, cl_strerror(rc));
-    fail_unless_fmt(signo == signoexp, "different number of signatures loaded, expected %u, got %u\n",
+    ck_assert_msg(signo == signoexp, "different number of signatures loaded, expected %u, got %u\n",
                     signoexp, signo);
     free(str);
 
     rc = cl_engine_compile(engine);
-    fail_unless_fmt(rc == CL_SUCCESS, "failed to load %s: %s\n",
+    ck_assert_msg(rc == CL_SUCCESS, "failed to load %s: %s\n",
                     dbname, cl_strerror(rc));
 }
 
@@ -509,7 +509,7 @@ START_TEST(test_load_bytecode_jit)
     struct cl_engine *engine;
     cl_init(CL_INIT_DEFAULT);
     engine = cl_engine_new();
-    fail_unless(!!engine, "failed to create engine\n");
+    ck_assert_msg(!!engine, "failed to create engine\n");
 
     runload("input/bytecode.cvd", engine, 5);
 
@@ -523,7 +523,7 @@ START_TEST(test_load_bytecode_int)
     cl_init(CL_INIT_DEFAULT);
     engine                  = cl_engine_new();
     engine->dconf->bytecode = BYTECODE_INTERPRETER;
-    fail_unless(!!engine, "failed to create engine\n");
+    ck_assert_msg(!!engine, "failed to create engine\n");
 
     runload("input/bytecode.cvd", engine, 5);
 
@@ -541,7 +541,7 @@ static void *thread(void *arg)
 {
     struct cl_engine *engine;
     engine = cl_engine_new();
-    fail_unless(!!engine, "failed to create engine\n");
+    ck_assert_msg(!!engine, "failed to create engine\n");
     /* run all cl_load at once, to maximize chance of a crash
      * in case of a race condition */
     pthread_barrier_wait(&barrier);
diff --git a/unit_tests/check_clamav.c b/unit_tests/check_clamav.c
index 603aa82..762f9dc 100644
--- a/unit_tests/check_clamav.c
+++ b/unit_tests/check_clamav.c
@@ -33,30 +33,23 @@ static int fpu_words = FPU_ENDIAN_INITME;
 
 /* extern void cl_free(struct cl_engine *engine); */
 START_TEST(test_cl_free)
-/*
-    struct cl_engine *engine = NULL;
-    cl_free(NULL);
-*/
-END_TEST
-
-/* extern struct cl_engine *cl_dup(struct cl_engine *engine); */
-START_TEST(test_cl_dup)
-/*
-    struct cl_engine *engine;
-    fail_unless(NULL == cl_dup(NULL), "cl_dup null pointer");
-    */
+{
+    // struct cl_engine *engine = NULL;
+    // cl_free(NULL);
+}
 END_TEST
 
 /* extern int cl_build(struct cl_engine *engine); */
 START_TEST(test_cl_build)
-/*
-    struct cl_engine *engine;
-    fail_unless(CL_ENULLARG == cl_build(NULL), "cl_build null pointer");
-    engine = calloc(sizeof(struct cl_engine),1);
-    fail_unless(engine, "cl_build calloc");
-    fail_unless(CL_ENULLARG == cl_build(engine), "cl_build(engine) with null ->root");
-    */
-/*    engine->root = cli_calloc(CL_TARGET_TABLE_SIZE, sizeof(struct cli_matcher *)); */
+{
+    // struct cl_engine *engine;
+    // ck_assert_msg(CL_ENULLARG == cl_build(NULL), "cl_build null pointer");
+    // engine = calloc(sizeof(struct cl_engine),1);
+    // ck_assert_msg(engine, "cl_build calloc");
+    // ck_assert_msg(CL_ENULLARG == cl_build(engine), "cl_build(engine) with null ->root");
+
+    // engine->root = cli_calloc(CL_TARGET_TABLE_SIZE, sizeof(struct cli_matcher *));
+}
 END_TEST
 
 /* extern void cl_debug(void); */
@@ -65,18 +58,20 @@ START_TEST(test_cl_debug)
     int old_status = cli_debug_flag;
     cli_debug_flag = 0;
     cl_debug();
-    fail_unless(1 == cli_debug_flag, "cl_debug failed to set cli_debug_flag");
+    ck_assert_msg(1 == cli_debug_flag, "cl_debug failed to set cli_debug_flag");
 
     cli_debug_flag = 1;
     cl_debug();
-    fail_unless(1 == cli_debug_flag, "cl_debug failed when flag was already set");
+    ck_assert_msg(1 == cli_debug_flag, "cl_debug failed when flag was already set");
     cli_debug_flag = old_status;
 }
 END_TEST
 
 /* extern const char *cl_retdbdir(void); */
 START_TEST(test_cl_retdbdir)
-fail_unless(!strcmp(DATADIR, cl_retdbdir()), "cl_retdbdir");
+{
+    ck_assert_msg(!strcmp(DATADIR, cl_retdbdir()), "cl_retdbdir");
+}
 END_TEST
 
 #ifndef REPO_VERSION
@@ -87,80 +82,81 @@ END_TEST
 START_TEST(test_cl_retver)
 {
     const char *ver = cl_retver();
-    fail_unless(!strcmp(REPO_VERSION "" VERSION_SUFFIX, ver), "cl_retver");
-    fail_unless(strcspn(ver, "012345789") < strlen(ver),
+    ck_assert_msg(!strcmp(REPO_VERSION "" VERSION_SUFFIX, ver), "cl_retver");
+    ck_assert_msg(strcspn(ver, "012345789") < strlen(ver),
                 "cl_retver must have a number");
 }
 END_TEST
 
 /* extern void cl_cvdfree(struct cl_cvd *cvd); */
 START_TEST(test_cl_cvdfree)
-/*
-    struct cl_cvd *cvd1, *cvd2;
+{
+    // struct cl_cvd *cvd1, *cvd2;
 
-    cvd1 = malloc(sizeof(struct cl_cvd));
-    fail_unless(cvd1, "cvd malloc");
-    cl_cvdfree(cvd1);
+    // cvd1 = malloc(sizeof(struct cl_cvd));
+    // ck_assert_msg(cvd1, "cvd malloc");
+    // cl_cvdfree(cvd1);
 
-    cvd2 = malloc(sizeof(struct cl_cvd));
-    cvd2->time = malloc(1);
-    cvd2->md5 = malloc(1);
-    cvd2->dsig= malloc(1);
-    cvd2->builder = malloc(1);
-    fail_unless(cvd2, "cvd malloc");
-    fail_unless(cvd2->time, "cvd malloc");
-    fail_unless(cvd2->md5, "cvd malloc");
-    fail_unless(cvd2->dsig, "cvd malloc");
-    fail_unless(cvd2->builder, "cvd malloc");
-    cl_cvdfree(cvd2);
-    cl_cvdfree(NULL);
-*/
+    // cvd2 = malloc(sizeof(struct cl_cvd));
+    // cvd2->time = malloc(1);
+    // cvd2->md5 = malloc(1);
+    // cvd2->dsig= malloc(1);
+    // cvd2->builder = malloc(1);
+    // ck_assert_msg(cvd2, "cvd malloc");
+    // ck_assert_msg(cvd2->time, "cvd malloc");
+    // ck_assert_msg(cvd2->md5, "cvd malloc");
+    // ck_assert_msg(cvd2->dsig, "cvd malloc");
+    // ck_assert_msg(cvd2->builder, "cvd malloc");
+    // cl_cvdfree(cvd2);
+    // cl_cvdfree(NULL);
+}
 END_TEST
 
 /* extern int cl_statfree(struct cl_stat *dbstat); */
 START_TEST(test_cl_statfree)
-/*
-    struct cl_stat *stat;
-    fail_unless(CL_ENULLARG == cl_statfree(NULL), "cl_statfree(NULL)");
+{
+    // struct cl_stat *stat;
+    // ck_assert_msg(CL_ENULLARG == cl_statfree(NULL), "cl_statfree(NULL)");
 
-    stat = malloc(sizeof(struct cl_stat));
-    fail_unless(NULL != stat, "malloc");
-    fail_unless(CL_SUCCESS == cl_statfree(stat), "cl_statfree(empty_struct)");
+    // stat = malloc(sizeof(struct cl_stat));
+    // ck_assert_msg(NULL != stat, "malloc");
+    // ck_assert_msg(CL_SUCCESS == cl_statfree(stat), "cl_statfree(empty_struct)");
 
-    stat = malloc(sizeof(struct cl_stat));
-    fail_unless(NULL != stat, "malloc");
-    stat->stattab = strdup("test");
-    fail_unless(NULL != stat->stattab, "strdup");
-    fail_unless(CL_SUCCESS == cl_statfree(stat), "cl_statfree(stat with stattab)");
+    // stat = malloc(sizeof(struct cl_stat));
+    // ck_assert_msg(NULL != stat, "malloc");
+    // stat->stattab = strdup("test");
+    // ck_assert_msg(NULL != stat->stattab, "strdup");
+    // ck_assert_msg(CL_SUCCESS == cl_statfree(stat), "cl_statfree(stat with stattab)");
 
-    stat = malloc(sizeof(struct cl_stat));
-    fail_unless(NULL != stat, "malloc");
-    stat->stattab = NULL;
-    fail_unless(CL_SUCCESS == cl_statfree(stat), "cl_statfree(stat with stattab) set to NULL");
-*/
+    // stat = malloc(sizeof(struct cl_stat));
+    // ck_assert_msg(NULL != stat, "malloc");
+    // stat->stattab = NULL;
+    // ck_assert_msg(CL_SUCCESS == cl_statfree(stat), "cl_statfree(stat with stattab) set to NULL");
+}
 END_TEST
 
 /* extern unsigned int cl_retflevel(void); */
 START_TEST(test_cl_retflevel)
+{}
 END_TEST
 
 /* extern struct cl_cvd *cl_cvdhead(const char *file); */
 START_TEST(test_cl_cvdhead)
-/*
-    fail_unless(NULL == cl_cvdhead(NULL), "cl_cvdhead(null)");
-    fail_unless(NULL == cl_cvdhead("input/cl_cvdhead/1.txt"), "cl_cvdhead(515 byte file, all nulls)");
-*/
+{
+    // ck_assert_msg(NULL == cl_cvdhead(NULL), "cl_cvdhead(null)");
+    // ck_assert_msg(NULL == cl_cvdhead("input/cl_cvdhead/1.txt"), "cl_cvdhead(515 byte file, all nulls)");
     /* the data read from the file is passed to cl_cvdparse, test cases for that are separate */
+}
 END_TEST
 
 /* extern struct cl_cvd *cl_cvdparse(const char *head); */
 START_TEST(test_cl_cvdparse)
+{}
 END_TEST
 
 static int get_test_file(int i, char *file, unsigned fsize, unsigned long *size);
 static struct cl_engine *g_engine;
 
-#ifdef CHECK_HAVE_LOOPS
 /* int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, const struct cl_engine *engine, const struct cl_limits *limits, struct cl_scan_options* options) */
 START_TEST(test_cl_scandesc)
 {
@@ -180,8 +176,8 @@ START_TEST(test_cl_scandesc)
     cli_dbgmsg("scan end (scandesc) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scandesc failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scandesc failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
     close(fd);
 }
@@ -207,8 +203,8 @@ START_TEST(test_cl_scandesc_allscan)
     cli_dbgmsg("scan end (scandesc) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scandesc_allscan failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scandesc_allscan failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
     close(fd);
 }
@@ -235,8 +231,8 @@ START_TEST(test_cl_scanfile)
     cli_dbgmsg("scan end (scanfile) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanfile failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanfile failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
 }
 END_TEST
@@ -262,8 +258,8 @@ START_TEST(test_cl_scanfile_allscan)
     cli_dbgmsg("scan end (scanfile_allscan) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanfile_allscan failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanfile_allscan failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
 }
 END_TEST
@@ -289,8 +285,8 @@ START_TEST(test_cl_scanfile_callback)
     cli_dbgmsg("scan end (scanfile_cb) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanfile_cb failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanfile_cb failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
 }
 END_TEST
@@ -317,8 +313,8 @@ START_TEST(test_cl_scanfile_callback_allscan)
     cli_dbgmsg("scan end (scanfile_cb_allscan) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanfile_cb_allscan failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanfile_cb_allscan failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
 }
 END_TEST
@@ -343,8 +339,8 @@ START_TEST(test_cl_scandesc_callback)
     cli_dbgmsg("scan end (scandesc_cb) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanfile failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanfile failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
     close(fd);
 }
@@ -371,37 +367,41 @@ START_TEST(test_cl_scandesc_callback_allscan)
     cli_dbgmsg("scan end (scandesc_cb_allscan) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanfile_allscan failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanfile_allscan failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
     close(fd);
 }
 END_TEST
 
-#endif
-
 /* int cl_load(const char *path, struct cl_engine **engine, unsigned int *signo, unsigned int options) */
 START_TEST(test_cl_load)
+{}
 END_TEST
 
 /* int cl_cvdverify(const char *file) */
 START_TEST(test_cl_cvdverify)
+{}
 END_TEST
 
 /* int cl_statinidir(const char *dirname, struct cl_stat *dbstat) */
 START_TEST(test_cl_statinidir)
+{}
 END_TEST
 
 /* int cl_statchkdir(const struct cl_stat *dbstat) */
 START_TEST(test_cl_statchkdir)
+{}
 END_TEST
 
 /* void cl_settempdir(const char *dir, short leavetemps) */
 START_TEST(test_cl_settempdir)
+{}
 END_TEST
 
 /* const char *cl_strerror(int clerror) */
 START_TEST(test_cl_strerror)
+{}
 END_TEST
 
 static char **testfiles     = NULL;
@@ -441,7 +441,7 @@ static void init_testfiles(void)
     int expect = expected_testfiles;
 
     DIR *d = opendir(OBJDIR "/../test");
-    fail_unless(!!d, "opendir");
+    ck_assert_msg(!!d, "opendir");
     if (!d)
         return;
     testfiles   = NULL;
@@ -451,14 +451,14 @@ static void init_testfiles(void)
             continue;
         i++;
         testfiles = cli_realloc(testfiles, i * sizeof(*testfiles));
-        fail_unless(!!testfiles, "cli_realloc");
+        ck_assert_msg(!!testfiles, "cli_realloc");
         testfiles[i - 1] = strdup(dirent->d_name);
     }
     testfiles_n = i;
     if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN)
         expect--;
     expect -= skip_files();
-    fail_unless_fmt(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect);
+    ck_assert_msg(testfiles_n == expect, "testfiles: %d != %d", testfiles_n, expect);
 
     closedir(d);
 }
@@ -483,13 +483,13 @@ static void engine_setup(void)
 
     init_testfiles();
     if (!inited)
-        fail_unless(cl_init(CL_INIT_DEFAULT) == 0, "cl_init");
+        ck_assert_msg(cl_init(CL_INIT_DEFAULT) == 0, "cl_init");
     inited   = 1;
     g_engine = cl_engine_new();
-    fail_unless(!!g_engine, "engine");
-    fail_unless_fmt(cl_load(hdb, g_engine, &sigs, CL_DB_STDOPT) == 0, "cl_load %s", hdb);
-    fail_unless(sigs == 1, "sigs");
-    fail_unless(cl_engine_compile(g_engine) == 0, "cl_engine_compile");
+    ck_assert_msg(!!g_engine, "engine");
+    ck_assert_msg(cl_load(hdb, g_engine, &sigs, CL_DB_STDOPT) == 0, "cl_load %s", hdb);
+    ck_assert_msg(sigs == 1, "sigs");
+    ck_assert_msg(cl_engine_compile(g_engine) == 0, "cl_engine_compile");
 }
 
 static void engine_teardown(void)
@@ -503,16 +503,15 @@ static int get_test_file(int i, char *file, unsigned fsize, unsigned long *size)
     int fd;
     STATBUF st;
 
-    fail_unless(i < testfiles_n, "%i < %i %s", i, testfiles_n, file);
+    ck_assert_msg(i < testfiles_n, "%i < %i %s", i, testfiles_n, file);
     snprintf(file, fsize, OBJDIR "/../test/%s", testfiles[i]);
 
     fd = open(file, O_RDONLY);
-    fail_unless(fd > 0, "open");
-    fail_unless(FSTAT(fd, &st) == 0, "fstat");
+    ck_assert_msg(fd > 0, "open");
+    ck_assert_msg(FSTAT(fd, &st) == 0, "fstat");
     *size = st.st_size;
     return fd;
 }
-#ifdef CHECK_HAVE_LOOPS
 
 static off_t pread_cb(void *handle, void *buf, size_t count, off_t offset)
 {
@@ -535,15 +534,15 @@ START_TEST(test_cl_scanmap_callback_handle)
     int fd = get_test_file(_i, file, sizeof(file), &size);
     /* intentionally use different way than scanners.c for testing */
     map = cl_fmap_open_handle(&fd, 0, size, pread_cb, 1);
-    fail_unless(!!map, "cl_fmap_open_handle");
+    ck_assert_msg(!!map, "cl_fmap_open_handle");
 
     cli_dbgmsg("scanning (handle) %s\n", file);
     ret = cl_scanmap_callback(map, file, &virname, &scanned, g_engine, &options, NULL);
     cli_dbgmsg("scan end (handle) %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanmap_callback failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanmap_callback failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
     close(fd);
 }
@@ -566,15 +565,15 @@ START_TEST(test_cl_scanmap_callback_handle_allscan)
     int fd = get_test_file(_i, file, sizeof(file), &size);
     /* intentionally use different way than scanners.c for testing */
     map = cl_fmap_open_handle(&fd, 0, size, pread_cb, 1);
-    fail_unless(!!map, "cl_fmap_open_handle %s");
+    ck_assert_msg(!!map, "cl_fmap_open_handle %s");
 
     cli_dbgmsg("scanning (handle) allscan %s\n", file);
     ret = cl_scanmap_callback(map, file, &virname, &scanned, g_engine, &options, NULL);
     cli_dbgmsg("scan end (handle) allscan %s\n", file);
 
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanmap_callback allscan failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanmap_callback allscan failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s", virname);
     }
     close(fd);
 }
@@ -597,18 +596,18 @@ START_TEST(test_cl_scanmap_callback_mem)
     int fd = get_test_file(_i, file, sizeof(file), &size);
 
     mem = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
-    fail_unless(mem != MAP_FAILED, "mmap");
+    ck_assert_msg(mem != MAP_FAILED, "mmap");
 
     /* intentionally use different way than scanners.c for testing */
     map = cl_fmap_open_memory(mem, size);
-    fail_unless(!!map, "cl_fmap_open_mem");
+    ck_assert_msg(!!map, "cl_fmap_open_mem");
 
     cli_dbgmsg("scanning (mem) %s\n", file);
     ret = cl_scanmap_callback(map, file, &virname, &scanned, g_engine, &options, NULL);
     cli_dbgmsg("scan end (mem) %s\n", file);
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanmap_callback failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s for %s", virname, file);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanmap_callback failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s for %s", virname, file);
     }
     close(fd);
     cl_fmap_close(map);
@@ -635,36 +634,34 @@ START_TEST(test_cl_scanmap_callback_mem_allscan)
     int fd = get_test_file(_i, file, sizeof(file), &size);
 
     mem = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
-    fail_unless(mem != MAP_FAILED, "mmap");
+    ck_assert_msg(mem != MAP_FAILED, "mmap");
 
     /* intentionally use different way than scanners.c for testing */
     map = cl_fmap_open_memory(mem, size);
-    fail_unless(!!map, "cl_fmap_open_mem %s");
+    ck_assert_msg(!!map, "cl_fmap_open_mem %s");
 
     cli_dbgmsg("scanning (mem) allscan %s\n", file);
     ret = cl_scanmap_callback(map, file, &virname, &scanned, g_engine, &options, NULL);
     cli_dbgmsg("scan end (mem) allscan %s\n", file);
     if (!FALSE_NEGATIVE) {
-        fail_unless_fmt(ret == CL_VIRUS, "cl_scanmap_callback allscan failed for %s: %s", file, cl_strerror(ret));
-        fail_unless_fmt(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s for %s", virname, file);
+        ck_assert_msg(ret == CL_VIRUS, "cl_scanmap_callback allscan failed for %s: %s", file, cl_strerror(ret));
+        ck_assert_msg(virname && !strcmp(virname, "ClamAV-Test-File.UNOFFICIAL"), "virusname: %s for %s", virname, file);
     }
     close(fd);
     cl_fmap_close(map);
     munmap(mem, size);
 }
 END_TEST
-#endif
 
 static Suite *test_cl_suite(void)
 {
-    Suite *s           = suite_create("cl_api");
-    TCase *tc_cl       = tcase_create("cl_dup");
-    TCase *tc_cl_scan  = tcase_create("cl_scan");
+    Suite *s           = suite_create("cl_suite");
+    TCase *tc_cl       = tcase_create("cl_api");
+    TCase *tc_cl_scan  = tcase_create("cl_scan_api");
     char *user_timeout = NULL;
     int expect         = expected_testfiles;
     suite_add_tcase(s, tc_cl);
     tcase_add_test(tc_cl, test_cl_free);
-    tcase_add_test(tc_cl, test_cl_dup);
     tcase_add_test(tc_cl, test_cl_build);
     tcase_add_test(tc_cl, test_cl_debug);
     tcase_add_test(tc_cl, test_cl_retdbdir);
@@ -683,7 +680,7 @@ static Suite *test_cl_suite(void)
 
     suite_add_tcase(s, tc_cl_scan);
     tcase_add_checked_fixture(tc_cl_scan, engine_setup, engine_teardown);
-#ifdef CHECK_HAVE_LOOPS
+
     if (get_fpu_endian() == FPU_ENDIAN_UNKNOWN)
         expect--;
     expect -= skip_files();
@@ -708,7 +705,6 @@ static Suite *test_cl_suite(void)
     } else {
         printf("Using default test timeout; alter by setting 'T' env var (in seconds)\n");
     }
-#endif
     return s;
 }
 
@@ -725,8 +721,8 @@ static void data_setup(void)
 
     data  = malloc(sizeof(le_data) * DATA_REP);
     data2 = malloc(sizeof(le_data) * DATA_REP);
-    fail_unless(!!data, "unable to allocate memory for fixture");
-    fail_unless(!!data2, "unable to allocate memory for fixture");
+    ck_assert_msg(!!data, "unable to allocate memory for fixture");
+    ck_assert_msg(!!data2, "unable to allocate memory for fixture");
     p = data;
     /* make multiple copies of le_data, we need to run readint tests in a loop, so we need
          * to give it some data to run it on */
@@ -743,7 +739,6 @@ static void data_teardown(void)
     free(data2);
 }
 
-#ifdef CHECK_HAVE_LOOPS
 /* test reading with different alignments, _i is parameter from tcase_add_loop_test */
 START_TEST(test_cli_readint16)
 {
@@ -752,12 +747,12 @@ START_TEST(test_cli_readint16)
     /* read 2 bytes apart, start is not always aligned*/
     for (j = _i; j <= DATA_REP * sizeof(le_data) - 2; j += 2) {
         value = le_expected[j & 3];
-        fail_unless(cli_readint16(&data[j]) == value, "(1) data read must be little endian");
+        ck_assert_msg(cli_readint16(&data[j]) == value, "(1) data read must be little endian");
     }
     /* read 2 bytes apart, always aligned*/
     for (j = 0; j <= DATA_REP * sizeof(le_data) - 2; j += 2) {
         value = le_expected[j & 3];
-        fail_unless(cli_readint16(&data[j]) == value, "(2) data read must be little endian");
+        ck_assert_msg(cli_readint16(&data[j]) == value, "(2) data read must be little endian");
     }
 }
 END_TEST
@@ -769,12 +764,12 @@ START_TEST(test_cli_readint32)
     int32_t value = le_expected[_i & 3];
     /* read 4 bytes apart, start is not always aligned*/
     for (j = _i; j < DATA_REP * sizeof(le_data) - 4; j += 4) {
-        fail_unless(cli_readint32(&data[j]) == value, "(1) data read must be little endian");
+        ck_assert_msg(cli_readint32(&data[j]) == value, "(1) data read must be little endian");
     }
     value = le_expected[0];
     /* read 4 bytes apart, always aligned*/
     for (j = 0; j < DATA_REP * sizeof(le_data) - 4; j += 4) {
-        fail_unless(cli_readint32(&data[j]) == value, "(2) data read must be little endian");
+        ck_assert_msg(cli_readint32(&data[j]) == value, "(2) data read must be little endian");
     }
 }
 END_TEST
@@ -788,14 +783,14 @@ START_TEST(test_cli_writeint32)
         cli_writeint32(&data2[j], 0x12345678);
     }
     for (j = _i; j < DATA_REP * sizeof(le_data) - 4; j += 4) {
-        fail_unless(cli_readint32(&data2[j]) == 0x12345678, "write/read mismatch");
+        ck_assert_msg(cli_readint32(&data2[j]) == 0x12345678, "write/read mismatch");
     }
     /* write 4 bytes apart, always aligned*/
     for (j = 0; j < DATA_REP * sizeof(le_data) - 4; j += 4) {
         cli_writeint32(&data2[j], 0x12345678);
     }
     for (j = 0; j < DATA_REP * sizeof(le_data) - 4; j += 4) {
-        fail_unless(cli_readint32(&data2[j]) == 0x12345678, "write/read mismatch");
+        ck_assert_msg(cli_readint32(&data2[j]) == 0x12345678, "write/read mismatch");
     }
 }
 END_TEST
@@ -830,7 +825,7 @@ static const size_t dsig_tests_cnt = sizeof(dsig_tests) / sizeof(dsig_tests[0]);
 
 START_TEST(test_cli_dsig)
 {
-    fail_unless(cli_versig(dsig_tests[_i].md5, dsig_tests[_i].dsig) == dsig_tests[_i].result,
+    ck_assert_msg(cli_versig(dsig_tests[_i].md5, dsig_tests[_i].dsig) == dsig_tests[_i].result,
                 "digital signature verification test failed");
 }
 END_TEST
@@ -868,18 +863,18 @@ START_TEST(test_sha256)
     memset(buf, 0x61, sizeof(buf));
 
     cl_sha256(tv1, sizeof(tv1), hsha256, NULL);
-    fail_unless(!memcmp(hsha256, res256[0], sizeof(hsha256)), "sha256 test vector #1 failed");
+    ck_assert_msg(!memcmp(hsha256, res256[0], sizeof(hsha256)), "sha256 test vector #1 failed");
 
     cl_sha256(tv2, sizeof(tv2), hsha256, NULL);
-    fail_unless(!memcmp(hsha256, res256[1], sizeof(hsha256)), "sha256 test vector #2 failed");
+    ck_assert_msg(!memcmp(hsha256, res256[1], sizeof(hsha256)), "sha256 test vector #2 failed");
 
     sha256 = cl_hash_init("sha256");
-    fail_unless(sha256 != NULL, "Could not create EVP_MD_CTX for sha256");
+    ck_assert_msg(sha256 != NULL, "Could not create EVP_MD_CTX for sha256");
 
     for (i = 0; i < 1000; i++)
         cl_update_hash(sha256, buf, sizeof(buf));
     cl_finish_hash(sha256, hsha256);
-    fail_unless(!memcmp(hsha256, res256[2], sizeof(hsha256)), "sha256 test vector #3 failed");
+    ck_assert_msg(!memcmp(hsha256, res256[2], sizeof(hsha256)), "sha256 test vector #3 failed");
 }
 END_TEST
 
@@ -890,90 +885,90 @@ START_TEST(test_sanitize_path)
 
     unsanitized = "";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL != sanitized, "sanitize_path: Empty path test failed");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: Empty path test failed");
 
     unsanitized = NULL;
     sanitized   = cli_sanitize_filepath(unsanitized, 0);
-    fail_if(NULL != sanitized, "sanitize_path: NULL path #1 test failed");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: NULL path #1 test failed");
 
     unsanitized = NULL;
     sanitized   = cli_sanitize_filepath(unsanitized, 50);
-    fail_if(NULL != sanitized, "sanitize_path: NULL path #2 test failed");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: NULL path #2 test failed");
 
     unsanitized = "badlen";
     sanitized   = cli_sanitize_filepath(unsanitized, 0);
-    fail_if(NULL != sanitized, "sanitize_path: Zero/bad path length test failed");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: Zero/bad path length test failed");
 
     unsanitized = ".." PATHSEP;
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL != sanitized, "sanitize_path: sanitized path should have been NULL");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: sanitized path should have been NULL");
 
     unsanitized = "." PATHSEP;
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL != sanitized, "sanitize_path: sanitized path should have been NULL (2)");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: sanitized path should have been NULL (2)");
 
     unsanitized = PATHSEP;
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL != sanitized, "sanitize_path: sanitized path should have been NULL (3)");
+    ck_assert_msg(NULL == sanitized, "sanitize_path: sanitized path should have been NULL (3)");
 
     unsanitized = ".." PATHSEP "relative_bad_1";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative_bad_1"), "sanitize_path: bad relative path test #1 failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative_bad_1"), "sanitize_path: bad relative path test #1 failed");
     free(sanitized);
 
     unsanitized = "relative" PATHSEP ".." PATHSEP "good";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative" PATHSEP ".." PATHSEP "good"), "sanitize_path: good relative path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative" PATHSEP ".." PATHSEP "good"), "sanitize_path: good relative path test failed");
     free(sanitized);
 
     unsanitized = "relative" PATHSEP ".." PATHSEP ".." PATHSEP "bad_2";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative" PATHSEP ".." PATHSEP "bad_2"), "sanitize_path: bad relative path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative" PATHSEP ".." PATHSEP "bad_2"), "sanitize_path: bad relative path test failed");
     free(sanitized);
 
     unsanitized = "relative" PATHSEP "." PATHSEP ".." PATHSEP ".." PATHSEP "bad_current";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative" PATHSEP ".." PATHSEP "bad_current"), "sanitize_path: bad relative current path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative" PATHSEP ".." PATHSEP "bad_current"), "sanitize_path: bad relative current path test failed");
     free(sanitized);
 
     unsanitized = "relative/../../bad_win_posix_path";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative/../bad_win_posix_path"), "sanitize_path: bad relative win posix path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative/../bad_win_posix_path"), "sanitize_path: bad relative win posix path test failed");
     free(sanitized);
 
     unsanitized = "" PATHSEP "absolute" PATHSEP ".." PATHSEP ".." PATHSEP "bad";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "absolute" PATHSEP ".." PATHSEP "bad"), "sanitize_path: bad absolute path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "absolute" PATHSEP ".." PATHSEP "bad"), "sanitize_path: bad absolute path test failed");
     free(sanitized);
 
     unsanitized = "" PATHSEP "absolute" PATHSEP ".." PATHSEP "good";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "absolute" PATHSEP ".." PATHSEP "good"), "sanitize_path: good absolute path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "absolute" PATHSEP ".." PATHSEP "good"), "sanitize_path: good absolute path test failed");
     free(sanitized);
 
     unsanitized = "relative" PATHSEP "normal";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative" PATHSEP "normal"), "sanitize_path: relative normal path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative" PATHSEP "normal"), "sanitize_path: relative normal path test failed");
     free(sanitized);
 
     unsanitized = "relative" PATHSEP PATHSEP "doublesep";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative" PATHSEP "doublesep"), "sanitize_path: relative double sep path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative" PATHSEP "doublesep"), "sanitize_path: relative double sep path test failed");
     free(sanitized);
 
     unsanitized = "relative" PATHSEP "shortname" PATHSEP "1";
     sanitized   = cli_sanitize_filepath(unsanitized, strlen(unsanitized));
-    fail_if(NULL == sanitized);
-    fail_unless(!strcmp(sanitized, "relative" PATHSEP "shortname" PATHSEP "1"), "sanitize_path: relative short name path test failed");
+    ck_assert(NULL != sanitized);
+    ck_assert_msg(!strcmp(sanitized, "relative" PATHSEP "shortname" PATHSEP "1"), "sanitize_path: relative short name path test failed");
     free(sanitized);
 }
 END_TEST
@@ -1000,7 +995,6 @@ static Suite *test_cli_suite(void)
 
     return s;
 }
-#endif /* CHECK_HAVE_LOOPS */
 
 void errmsg_expected(void)
 {
@@ -1019,11 +1013,11 @@ int open_testfile(const char *name)
     }
 
     str = cli_malloc(strlen(name) + strlen(srcdir) + 2);
-    fail_unless(!!str, "cli_malloc");
+    ck_assert_msg(!!str, "cli_malloc");
     sprintf(str, "%s/%s", srcdir, name);
 
     fd = open(str, O_RDONLY);
-    fail_unless_fmt(fd >= 0, "open() failed: %s", str);
+    ck_assert_msg(fd >= 0, "open() failed: %s", str);
     free(str);
     return fd;
 }
@@ -1034,9 +1028,9 @@ void diff_file_mem(int fd, const char *ref, size_t len)
     size_t p, reflen = len;
     char *buf = cli_malloc(len);
 
-    fail_unless_fmt(!!buf, "unable to malloc buffer: %d", len);
+    ck_assert_msg(!!buf, "unable to malloc buffer: %d", len);
     p = read(fd, buf, len);
-    fail_unless_fmt(p == len, "file is smaller: %lu, expected: %lu", p, len);
+    ck_assert_msg(p == len, "file is smaller: %lu, expected: %lu", p, len);
     p = 0;
     while (len > 0) {
         c1 = ref[p];
@@ -1047,10 +1041,10 @@ void diff_file_mem(int fd, const char *ref, size_t len)
         len--;
     }
     if (len > 0)
-        fail_unless_fmt(c1 == c2, "file contents mismatch at byte: %lu, was: %c, expected: %c", p, c2, c1);
+        ck_assert_msg(c1 == c2, "file contents mismatch at byte: %lu, was: %c, expected: %c", p, c2, c1);
     free(buf);
     p = lseek(fd, 0, SEEK_END);
-    fail_unless_fmt(p == reflen, "trailing garbage, file size: %ld, expected: %ld", p, reflen);
+    ck_assert_msg(p == reflen, "trailing garbage, file size: %ld, expected: %ld", p, reflen);
     close(fd);
 }
 
@@ -1059,14 +1053,14 @@ void diff_files(int fd, int ref_fd)
     char *ref;
     ssize_t nread;
     off_t siz = lseek(ref_fd, 0, SEEK_END);
-    fail_unless_fmt(siz != -1, "lseek failed");
+    ck_assert_msg(siz != -1, "lseek failed");
 
     ref = cli_malloc(siz);
-    fail_unless_fmt(!!ref, "unable to malloc buffer: %d", siz);
+    ck_assert_msg(!!ref, "unable to malloc buffer: %d", siz);
 
-    fail_unless_fmt(lseek(ref_fd, 0, SEEK_SET) == 0, "lseek failed");
+    ck_assert_msg(lseek(ref_fd, 0, SEEK_SET) == 0, "lseek failed");
     nread = read(ref_fd, ref, siz);
-    fail_unless_fmt(nread == siz, "short read, expected: %ld, was: %ld", siz, nread);
+    ck_assert_msg(nread == siz, "short read, expected: %ld, was: %ld", siz, nread);
     close(ref_fd);
     diff_file_mem(fd, ref, siz);
     free(ref);
@@ -1085,10 +1079,10 @@ void dconf_setup(void)
     dconf = NULL;
 #ifdef USE_MPOOL
     pool = mpool_create();
-    fail_unless(!!pool, "unable to create pool");
+    ck_assert_msg(!!pool, "unable to create pool");
 #endif
     dconf = cli_mpool_dconf_init(pool);
-    fail_unless(!!dconf, "failed to init dconf");
+    ck_assert_msg(!!dconf, "failed to init dconf");
 }
 
 void dconf_teardown(void)
@@ -1135,11 +1129,8 @@ int main(void)
     check_version_compatible();
     s  = test_cl_suite();
     sr = srunner_create(s);
-#ifdef CHECK_HAVE_LOOPS
+
     srunner_add_suite(sr, test_cli_suite());
-#else
-    printf("*** Warning ***: your check version is too old,\nseveral important tests will not execute\n");
-#endif
     srunner_add_suite(sr, test_jsnorm_suite());
     srunner_add_suite(sr, test_str_suite());
     srunner_add_suite(sr, test_regex_suite());
diff --git a/unit_tests/check_clamd.c b/unit_tests/check_clamd.c
index cd0627b..6b5557c 100644
--- a/unit_tests/check_clamd.c
+++ b/unit_tests/check_clamd.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for clamd.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2009-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -53,7 +53,6 @@
 #include "libclamav/clamav.h"
 #include "libclamav/version.h"
 
-#ifdef CHECK_HAVE_LOOPS
 
 static int sockd;
 #define SOCKET "clamd-test.socket"
@@ -68,10 +67,10 @@ static void conn_setup_mayfail(int may)
     sockd = socket(AF_UNIX, SOCK_STREAM, 0);
     if (sockd == -1 && (may && (errno == EMFILE || errno == ENFILE)))
         return;
-    fail_unless_fmt(sockd != -1, "Unable to create socket: %s\n", strerror(errno));
+    ck_assert_msg(sockd != -1, "Unable to create socket: %s\n", strerror(errno));
 
     rc = connect(sockd, (struct sockaddr *)&nixsock, (socklen_t)sizeof(nixsock));
-    fail_unless_fmt(rc != -1, "Unable to connect(): %s\n", strerror(errno));
+    ck_assert_msg(rc != -1, "Unable to connect(): %s\n", strerror(errno));
 
     signal(SIGPIPE, SIG_IGN);
 }
@@ -86,7 +85,7 @@ static int conn_tcp(int port)
     struct sockaddr_in server;
     int rc;
     int sd = socket(AF_INET, SOCK_STREAM, 0);
-    fail_unless_fmt(sd != -1, "Unable to create socket: %s\n", strerror(errno));
+    ck_assert_msg(sd != -1, "Unable to create socket: %s\n", strerror(errno));
 
     memset(&server, 0, sizeof(server));
     server.sin_family      = AF_INET;
@@ -94,7 +93,7 @@ static int conn_tcp(int port)
     server.sin_addr.s_addr = inet_addr("127.0.0.1");
 
     rc = connect(sd, (struct sockaddr *)&server, (socklen_t)sizeof(server));
-    fail_unless_fmt(rc != -1, "Unable to connect(): %s\n", strerror(errno));
+    ck_assert_msg(rc != -1, "Unable to connect(): %s\n", strerror(errno));
     return sd;
 }
 
@@ -128,16 +127,16 @@ static void commands_setup(void)
     const char *nonempty = "NONEMPTYFILE";
     int fd               = open(NONEXISTENT, O_RDONLY);
     if (fd != -1) close(fd);
-    fail_unless(fd == -1, "Nonexistent file exists!\n");
+    ck_assert_msg(fd == -1, "Nonexistent file exists!\n");
 
     fd = open(ACCDENIED, O_CREAT | O_WRONLY, S_IWUSR);
-    fail_unless_fmt(fd != -1,
+    ck_assert_msg(fd != -1,
                     "Failed to create file for access denied tests: %s\n", strerror(errno));
 
-    fail_unless_fmt(fchmod(fd, S_IWUSR) != -1,
+    ck_assert_msg(fchmod(fd, S_IWUSR) != -1,
                     "Failed to chmod: %s\n", strerror(errno));
     /* must not be empty file */
-    fail_unless_fmt((size_t)write(fd, nonempty, strlen(nonempty)) == strlen(nonempty),
+    ck_assert_msg((size_t)write(fd, nonempty, strlen(nonempty)) == strlen(nonempty),
                     "Failed to write into testfile: %s\n", strerror(errno));
     close(fd);
 
@@ -213,10 +212,10 @@ static void *recvpartial(int sd, size_t *len, int partial)
         if (off + BUFSIZ > *len) {
             *len += BUFSIZ + 1;
             buf = realloc(buf, *len);
-            fail_unless(!!buf, "Cannot realloc buffer\n");
+            ck_assert_msg(!!buf, "Cannot realloc buffer\n");
         }
         rc = recv(sd, buf + off, BUFSIZ, 0);
-        fail_unless_fmt(rc != -1, "recv() failed: %s\n", strerror(errno));
+        ck_assert_msg(rc != -1, "recv() failed: %s\n", strerror(errno));
         off += rc;
     } while (rc && (!partial || !memchr(buf, '\0', off)));
     *len      = off;
@@ -235,24 +234,23 @@ static void test_command(const char *cmd, size_t len, const char *extra, const c
     ssize_t rc;
 
     rc = send(sockd, cmd, len, 0);
-    fail_unless_fmt((size_t)rc == len, "Unable to send(): %s\n", strerror(errno));
+    ck_assert_msg((size_t)rc == len, "Unable to send(): %s\n", strerror(errno));
 
     if (extra) {
         rc = send(sockd, extra, strlen(extra), 0);
-        fail_unless_fmt((size_t)rc == strlen(extra), "Unable to send() extra for %s: %s\n", cmd, strerror(errno));
+        ck_assert_msg((size_t)rc == strlen(extra), "Unable to send() extra for %s: %s\n", cmd, strerror(errno));
     }
     shutdown(sockd, SHUT_WR);
     recvdata = recvfull(sockd, &len);
 
-    fail_unless_fmt(len == expect_len, "Reply has wrong size: %lu, expected %lu, reply: %s, expected: %s\n",
+    ck_assert_msg(len == expect_len, "Reply has wrong size: %lu, expected %lu, reply: %s, expected: %s\n",
                     len, expect_len, recvdata, expect);
 
     rc = memcmp(recvdata, expect, expect_len);
-    fail_unless_fmt(!rc, "Wrong reply for command %s: |%s|, expected: |%s|\n", cmd, recvdata, expect);
+    ck_assert_msg(!rc, "Wrong reply for command %s: |%s|, expected: |%s|\n", cmd, recvdata, expect);
     free(recvdata);
 }
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(test_basic_commands)
 {
     struct basic_test *test = &basic_tests[_i];
@@ -314,7 +312,6 @@ START_TEST(test_compat_commands)
     }
 }
 END_TEST
-#endif
 
 #define EXPECT_INSTREAM "stream: ClamAV-Test-File.UNOFFICIAL FOUND\n"
 #define EXPECT_INSTREAM0 "stream: ClamAV-Test-File.UNOFFICIAL FOUND"
@@ -328,18 +325,18 @@ START_TEST(test_stats)
 
     conn_setup();
     rc = send(sockd, "nSTATS\n", len, 0);
-    fail_unless_fmt((size_t)rc == len, "Unable to send(): %s\n", strerror(errno));
+    ck_assert_msg((size_t)rc == len, "Unable to send(): %s\n", strerror(errno));
 
     recvdata = recvfull(sockd, &len);
 
-    fail_unless_fmt(len > strlen(STATS_REPLY), "Reply has wrong size: %lu, minimum %lu, reply: %s\n",
+    ck_assert_msg(len > strlen(STATS_REPLY), "Reply has wrong size: %lu, minimum %lu, reply: %s\n",
                     len, strlen(STATS_REPLY), recvdata);
 
     if (len > strlen(STATS_REPLY))
         len = strlen(STATS_REPLY);
     rc = strncmp(recvdata, STATS_REPLY, len);
 
-    fail_unless_fmt(rc == 0, "Wrong reply: %s\n", recvdata);
+    ck_assert_msg(rc == 0, "Wrong reply: %s\n", recvdata);
     free(recvdata);
     conn_teardown();
 }
@@ -350,16 +347,16 @@ static size_t prepare_instream(char *buf, size_t off, size_t buflen)
     STATBUF stbuf;
     int fd, nread;
     uint32_t chunk;
-    fail_unless_fmt(CLAMSTAT(SCANFILE, &stbuf) != -1, "stat failed for %s: %s", SCANFILE, strerror(errno));
+    ck_assert_msg(CLAMSTAT(SCANFILE, &stbuf) != -1, "stat failed for %s: %s", SCANFILE, strerror(errno));
 
     fd = open(SCANFILE, O_RDONLY);
-    fail_unless_fmt(fd != -1, "open failed: %s\n", strerror(errno));
+    ck_assert_msg(fd != -1, "open failed: %s\n", strerror(errno));
 
     chunk = htonl(stbuf.st_size);
     memcpy(&buf[off], &chunk, sizeof(chunk));
     off += 4;
     nread = read(fd, &buf[off], buflen - off - 4);
-    fail_unless_fmt(nread == stbuf.st_size, "read failed: %d != %d, %s\n", nread, stbuf.st_size, strerror(errno));
+    ck_assert_msg(nread == stbuf.st_size, "read failed: %d != %d, %s\n", nread, stbuf.st_size, strerror(errno));
     off += nread;
     buf[off++] = 0;
     buf[off++] = 0;
@@ -380,16 +377,16 @@ START_TEST(test_instream)
     off = prepare_instream(buf, off, sizeof(buf));
 
     conn_setup();
-    fail_unless((size_t)send(sockd, buf, off, 0) == off, "send() failed: %s\n", strerror(errno));
+    ck_assert_msg((size_t)send(sockd, buf, off, 0) == off, "send() failed: %s\n", strerror(errno));
 
     recvdata = recvfull(sockd, &len);
 
     expect_len = strlen(EXPECT_INSTREAM);
-    fail_unless_fmt(len == expect_len, "Reply has wrong size: %lu, expected %lu, reply: %s\n",
+    ck_assert_msg(len == expect_len, "Reply has wrong size: %lu, expected %lu, reply: %s\n",
                     len, expect_len, recvdata);
 
     rc = memcmp(recvdata, EXPECT_INSTREAM, expect_len);
-    fail_unless_fmt(!rc, "Wrong reply for command INSTREAM: |%s|, expected: |%s|\n", recvdata, EXPECT_INSTREAM);
+    ck_assert_msg(!rc, "Wrong reply for command INSTREAM: |%s|, expected: |%s|\n", recvdata, EXPECT_INSTREAM);
     free(recvdata);
 
     conn_teardown();
@@ -412,7 +409,7 @@ static int sendmsg_fd(int sockd, const char *mesg, size_t msg_len, int fd, int s
         iov[0].iov_len  = 1;
     } else {
         /* send single message with ancillary data */
-        fail_unless(msg_len < sizeof(dummy) - 1, "message too large");
+        ck_assert_msg(msg_len < sizeof(dummy) - 1, "message too large");
         memcpy(dummy, mesg, msg_len);
         dummy[msg_len]  = '\0';
         iov[0].iov_base = dummy;
@@ -447,7 +444,7 @@ static void tst_fildes(const char *cmd, size_t len, int fd,
     int rc;
 
     conn_setup();
-    fail_unless_fmt(sendmsg_fd(sockd, cmd, len, fd, singlemsg) != -1,
+    ck_assert_msg(sendmsg_fd(sockd, cmd, len, fd, singlemsg) != -1,
                     "Failed to sendmsg: %s\n", strerror(errno));
 
     if (closefd)
@@ -456,17 +453,17 @@ static void tst_fildes(const char *cmd, size_t len, int fd,
     recvdata = recvfull(sockd, &len);
     p        = strchr(recvdata, ':');
 
-    fail_unless_fmt(!!p, "Reply doesn't contain ':' : %s\n", recvdata);
+    ck_assert_msg(!!p, "Reply doesn't contain ':' : %s\n", recvdata);
     *p++ = '\0';
 
-    fail_unless_fmt(sscanf(recvdata, "fd[%u]", &rc) == 1, "Reply doesn't contain fd: %s\n", recvdata);
+    ck_assert_msg(sscanf(recvdata, "fd[%u]", &rc) == 1, "Reply doesn't contain fd: %s\n", recvdata);
 
     len -= p - recvdata;
-    fail_unless_fmt(len == expect_len, "Reply has wrong size: %lu, expected %lu, reply: %s, expected: %s\n",
+    ck_assert_msg(len == expect_len, "Reply has wrong size: %lu, expected %lu, reply: %s, expected: %s\n",
                     len, expect_len, p, expect);
 
     rc = memcmp(p, expect, expect_len);
-    fail_unless_fmt(!rc, "Wrong reply for command %s: |%s|, expected: |%s|\n", cmd, p, expect);
+    ck_assert_msg(!rc, "Wrong reply for command %s: |%s|, expected: |%s|\n", cmd, p, expect);
     free(recvdata);
     conn_teardown();
 }
@@ -488,7 +485,6 @@ static struct cmds {
         {"nFILDES", '\n', CLEANFILE, CLEANFDREPLY},
         {"zFILDES", '\0', CLEANFILE, CLEANFDREPLY}};
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(test_fildes)
 {
     char nreply[BUFSIZ], nsend[BUFSIZ];
@@ -522,7 +518,7 @@ START_TEST(test_fildes)
     nsend_len  = snprintf(nsend, sizeof(nsend), "%s%c", cmd->cmd, cmd->term);
 
     fd = open(cmd->file, O_RDONLY);
-    fail_unless_fmt(fd != -1, "Failed to open: %s\n", strerror(errno));
+    ck_assert_msg(fd != -1, "Failed to open: %s\n", strerror(errno));
 
     tst_fildes(nsend, nsend_len, fd, nreply, nreply_len, closefd, singlemsg);
 
@@ -534,7 +530,6 @@ START_TEST(test_fildes)
     }
 }
 END_TEST
-#endif
 
 START_TEST(test_fildes_many)
 {
@@ -542,9 +537,9 @@ START_TEST(test_fildes_many)
     int dummyfd, i, killed = 0;
     conn_setup();
     dummyfd = open(SCANFILE, O_RDONLY);
-    fail_unless_fmt(dummyfd != -1, "failed to open %s: %s\n", SCANFILE, strerror(errno));
+    ck_assert_msg(dummyfd != -1, "failed to open %s: %s\n", SCANFILE, strerror(errno));
 
-    fail_unless_fmt(send(sockd, idsession, sizeof(idsession), 0) == sizeof(idsession), "send IDSESSION failed\n");
+    ck_assert_msg(send(sockd, idsession, sizeof(idsession), 0) == sizeof(idsession), "send IDSESSION failed\n");
     for (i = 0; i < 1024; i++) {
         if (sendmsg_fd(sockd, "zFILDES", sizeof("zFILDES"), dummyfd, 1) == -1) {
             killed = 1;
@@ -573,12 +568,12 @@ START_TEST(test_fildes_unwanted)
 
     /* send a 'zVERSION\0' including the ancillary data.
      * The \0 is from the extra char needed when sending ancillary data */
-    fail_unless_fmt(sendmsg_fd(sockd, "zIDSESSION", strlen("zIDSESSION"), dummyfd, 1) != -1,
+    ck_assert_msg(sendmsg_fd(sockd, "zIDSESSION", strlen("zIDSESSION"), dummyfd, 1) != -1,
                     "sendmsg failed: %s\n", strerror(errno));
 
     recvdata = recvfull(sockd, &len);
 
-    fail_unless_fmt(!strcmp(recvdata, "1: PROTOCOL ERROR: ancillary data sent without FILDES. ERROR"),
+    ck_assert_msg(!strcmp(recvdata, "1: PROTOCOL ERROR: ancillary data sent without FILDES. ERROR"),
                     "Wrong reply: %s\n", recvdata);
 
     free(recvdata);
@@ -596,21 +591,21 @@ START_TEST(test_idsession_stress)
 
     conn_setup();
 
-    fail_unless_fmt(send(sockd, "zIDSESSION", sizeof("zIDSESSION"), 0) == sizeof("zIDSESSION"),
+    ck_assert_msg(send(sockd, "zIDSESSION", sizeof("zIDSESSION"), 0) == sizeof("zIDSESSION"),
                     "send() failed: %s\n", strerror(errno));
     for (i = 0; i < 1024; i++) {
         snprintf(buf, sizeof(buf), "%u", (unsigned)(i + 1));
-        fail_unless(send(sockd, "zVERSION", sizeof("zVERSION"), 0) == sizeof("zVERSION"),
+        ck_assert_msg(send(sockd, "zVERSION", sizeof("zVERSION"), 0) == sizeof("zVERSION"),
                     "send failed: %s\n", strerror(errno));
         data = recvpartial(sockd, &len, 1);
         p    = strchr(data, ':');
-        fail_unless_fmt(!!p, "wrong VERSION reply (%u): %s\n", i, data);
+        ck_assert_msg(!!p, "wrong VERSION reply (%u): %s\n", i, data);
         *p++ = '\0';
-        fail_unless_fmt(*p == ' ', "wrong VERSION reply (%u): %s\n", i, p);
+        ck_assert_msg(*p == ' ', "wrong VERSION reply (%u): %s\n", i, p);
         *p++ = '\0';
 
-        fail_unless_fmt(!strcmp(p, VERSION_REPLY), "wrong VERSION reply: %s\n", data);
-        fail_unless_fmt(!strcmp(data, buf), "wrong IDSESSION id: %s\n", data);
+        ck_assert_msg(!strcmp(p, VERSION_REPLY), "wrong VERSION reply: %s\n", data);
+        ck_assert_msg(!strcmp(data, buf), "wrong IDSESSION id: %s\n", data);
 
         free(data);
     }
@@ -628,12 +623,12 @@ START_TEST(test_connections)
     struct rlimit rlim;
     int *sock;
     int nf, maxfd = 0;
-    fail_unless_fmt(getrlimit(RLIMIT_NOFILE, &rlim) != -1,
+    ck_assert_msg(getrlimit(RLIMIT_NOFILE, &rlim) != -1,
                     "Failed to get RLIMIT_NOFILE: %s\n", strerror(errno));
     nf   = rlim.rlim_cur - 5;
     sock = malloc(sizeof(int) * nf);
 
-    fail_unless(!!sock, "malloc failed\n");
+    ck_assert_msg(!!sock, "malloc failed\n");
 
     for (i = 0; i < nf; i++) {
         /* just open connections, and let them time out */
@@ -647,7 +642,7 @@ START_TEST(test_connections)
             maxfd = sockd;
     }
     rc = fork();
-    fail_unless(rc != -1, "fork() failed: %s\n", strerror(errno));
+    ck_assert_msg(rc != -1, "fork() failed: %s\n", strerror(errno));
     if (rc == 0) {
         char dummy;
         int ret;
@@ -696,13 +691,13 @@ START_TEST(test_stream)
 
     infd = open(SCANFILE, O_RDONLY);
 
-    fail_unless_fmt(infd != -1, "open failed: %s\n", strerror(errno));
+    ck_assert_msg(infd != -1, "open failed: %s\n", strerror(errno));
     conn_setup();
-    fail_unless_fmt(
+    ck_assert_msg(
         send(sockd, "zSTREAM", sizeof("zSTREAM"), 0) == sizeof("zSTREAM"),
         "send failed: %s\n", strerror(errno));
     recvdata = recvpartial(sockd, &len, 1);
-    fail_unless_fmt(sscanf(recvdata, "PORT %u\n", &port) == 1,
+    ck_assert_msg(sscanf(recvdata, "PORT %u\n", &port) == 1,
                     "Wrong stream reply: %s\n", recvdata);
 
     free(recvdata);
@@ -711,15 +706,15 @@ START_TEST(test_stream)
     do {
         nread = read(infd, buf, sizeof(buf));
         if (nread > 0)
-            fail_unless_fmt(send(streamsd, buf, nread, 0) == nread,
+            ck_assert_msg(send(streamsd, buf, nread, 0) == nread,
                             "send failed: %s\n", strerror(errno));
     } while (nread > 0 || (nread == -1 && errno == EINTR));
-    fail_unless_fmt(nread != -1, "read failed: %s\n", strerror(errno));
+    ck_assert_msg(nread != -1, "read failed: %s\n", strerror(errno));
     close(infd);
     close(streamsd);
 
     recvdata = recvfull(sockd, &len);
-    fail_unless_fmt(!strcmp(recvdata, "stream: ClamAV-Test-File.UNOFFICIAL FOUND"),
+    ck_assert_msg(!strcmp(recvdata, "stream: ClamAV-Test-File.UNOFFICIAL FOUND"),
                     "Wrong reply: %s\n", recvdata);
     free(recvdata);
 
@@ -743,13 +738,13 @@ static void test_idsession_commands(int split, int instream)
         if (test->skiproot && isroot)
             continue;
         if (test->ids == IDS_OK) {
-            fail_unless(p + strlen(test->command) + 2 < buf + sizeof(buf), "Buffer too small");
+            ck_assert_msg(p + strlen(test->command) + 2 < buf + sizeof(buf), "Buffer too small");
             *p++ = 'z';
             strcpy(p, test->command);
             p += strlen(test->command);
             *p++ = '\0';
             if (test->extra) {
-                fail_unless(p + strlen(test->extra) < buf + sizeof(buf), "Buffer too small");
+                ck_assert_msg(p + strlen(test->extra) < buf + sizeof(buf), "Buffer too small");
                 strcpy(p, test->extra);
                 p += strlen(test->extra);
             }
@@ -759,12 +754,12 @@ static void test_idsession_commands(int split, int instream)
             uint32_t chunk;
             /* IDS_END - in middle of other commands, perfect for inserting
 	     * INSTREAM */
-            fail_unless(p + sizeof(INSTREAM_CMD) + 544 < buf + sizeof(buf), "Buffer too small");
+            ck_assert_msg(p + sizeof(INSTREAM_CMD) + 544 < buf + sizeof(buf), "Buffer too small");
             memcpy(p, INSTREAM_CMD, sizeof(INSTREAM_CMD));
             p += sizeof(INSTREAM_CMD);
             p += prepare_instream(p, 0, 552);
             replies[j++] = EXPECT_INSTREAM0;
-            fail_unless(p + sizeof(INSTREAM_CMD) + 16388 < buf + sizeof(buf), "Buffer too small");
+            ck_assert_msg(p + sizeof(INSTREAM_CMD) + 16388 < buf + sizeof(buf), "Buffer too small");
             memcpy(p, INSTREAM_CMD, sizeof(INSTREAM_CMD));
             p += sizeof(INSTREAM_CMD);
             chunk = htonl(16384);
@@ -779,16 +774,16 @@ static void test_idsession_commands(int split, int instream)
             replies[j++] = "stream: OK";
         }
     }
-    fail_unless(p + sizeof(END_CMD) < buf + sizeof(buf), "Buffer too small");
+    ck_assert_msg(p + sizeof(END_CMD) < buf + sizeof(buf), "Buffer too small");
     memcpy(p, END_CMD, sizeof(END_CMD));
     p += sizeof(END_CMD);
 
     if (split) {
         /* test corner-cases: 1-byte sends */
         for (i = 0; i < (size_t)(p - buf); i++)
-            fail_unless((size_t)send(sockd, &buf[i], 1, 0) == 1, "send() failed: %u, %s\n", i, strerror(errno));
+            ck_assert_msg((size_t)send(sockd, &buf[i], 1, 0) == 1, "send() failed: %u, %s\n", i, strerror(errno));
     } else {
-        fail_unless(send(sockd, buf, p - buf, 0) == p - buf, "send() failed: %s\n", strerror(errno));
+        ck_assert_msg(send(sockd, buf, p - buf, 0) == p - buf, "send() failed: %s\n", strerror(errno));
     }
     recvdata = recvfull(sockd, &len);
     p        = recvdata;
@@ -799,13 +794,13 @@ static void test_idsession_commands(int split, int instream)
         if (test->ids == IDS_OK) {
             unsigned id;
             char *q = strchr(p, ':');
-            fail_unless_fmt(!!q, "No ID in reply: %s\n", p);
+            ck_assert_msg(!!q, "No ID in reply: %s\n", p);
             *q = '\0';
-            fail_unless_fmt(sscanf(p, "%u", &id) == 1, "Wrong ID in reply: %s\n", p);
-            fail_unless(id > 0, "ID cannot be zero");
-            fail_unless_fmt(id <= j, "ID too big: %u, max: %u\n", id, j);
+            ck_assert_msg(sscanf(p, "%u", &id) == 1, "Wrong ID in reply: %s\n", p);
+            ck_assert_msg(id > 0, "ID cannot be zero");
+            ck_assert_msg(id <= j, "ID too big: %u, max: %u\n", id, j);
             q += 2;
-            fail_unless_fmt(!strcmp(q, replies[id - 1]),
+            ck_assert_msg(!strcmp(q, replies[id - 1]),
                             "Wrong ID reply for ID %u: %s, expected %s\n",
                             id,
                             q, replies[id - 1]);
@@ -820,15 +815,15 @@ static void test_idsession_commands(int split, int instream)
 START_TEST(test_idsession)
 {
     conn_setup();
-    fail_unless_fmt((size_t)send(sockd, ID_CMD, sizeof(ID_CMD), 0) == sizeof(ID_CMD),
+    ck_assert_msg((size_t)send(sockd, ID_CMD, sizeof(ID_CMD), 0) == sizeof(ID_CMD),
                     "send() failed: %s\n", strerror(errno));
     test_idsession_commands(0, 0);
     conn_setup();
-    fail_unless_fmt((size_t)send(sockd, ID_CMD, sizeof(ID_CMD), 0) == sizeof(ID_CMD),
+    ck_assert_msg((size_t)send(sockd, ID_CMD, sizeof(ID_CMD), 0) == sizeof(ID_CMD),
                     "send() failed: %s\n", strerror(errno));
     test_idsession_commands(1, 0);
     conn_setup();
-    fail_unless_fmt((size_t)send(sockd, ID_CMD, sizeof(ID_CMD), 0) == sizeof(ID_CMD),
+    ck_assert_msg((size_t)send(sockd, ID_CMD, sizeof(ID_CMD), 0) == sizeof(ID_CMD),
                     "send() failed: %s\n", strerror(errno));
     test_idsession_commands(0, 1);
 }
@@ -841,11 +836,11 @@ static Suite *test_clamd_suite(void)
     tc_commands = tcase_create("clamd commands");
     suite_add_tcase(s, tc_commands);
     tcase_add_unchecked_fixture(tc_commands, commands_setup, commands_teardown);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_commands, test_basic_commands, 0, sizeof(basic_tests) / sizeof(basic_tests[0]));
     tcase_add_loop_test(tc_commands, test_compat_commands, 0, sizeof(basic_tests) / sizeof(basic_tests[0]));
     tcase_add_loop_test(tc_commands, test_fildes, 0, 4 * sizeof(fildes_cmds) / sizeof(fildes_cmds[0]));
-#endif
+
     tcase_add_test(tc_commands, test_stats);
     tcase_add_test(tc_commands, test_instream);
     tcase_add_test(tc_commands, test_stream);
@@ -877,12 +872,3 @@ int main(void)
     srunner_free(sr);
     return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-
-#else
-int main(void)
-{
-    puts("\n*** Check version too old, clamd tests not run!\n");
-    /* tell automake the test was skipped */
-    return 77;
-}
-#endif
diff --git a/unit_tests/check_disasm.c b/unit_tests/check_disasm.c
index 11b6426..db406a9 100644
--- a/unit_tests/check_disasm.c
+++ b/unit_tests/check_disasm.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for JS normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: aCaB <acab@clamav.net>
@@ -211,20 +211,20 @@ START_TEST(test_disasm_basic)
     off_t size;
     STATBUF st;
 
-    fail_unless(fd != -1, "mkstemp failed");
+    ck_assert_msg(fd != -1, "mkstemp failed");
     ref = open_testfile("input/disasmref.bin");
-    fail_unless(FSTAT(ref, &st) != -1, "fstat failed");
+    ck_assert_msg(FSTAT(ref, &st) != -1, "fstat failed");
     disasmbuf(buf, sizeof(buf), fd);
     size = lseek(fd, 0, SEEK_CUR);
-    fail_unless_fmt(size == st.st_size, "disasm size mismatch(value %u, expected: %u)", size, st.st_size);
+    ck_assert_msg(size == st.st_size, "disasm size mismatch(value %u, expected: %u)", size, st.st_size);
     lseek(fd, 0, SEEK_SET);
     d = malloc(size * 2);
-    fail_unless_fmt(d != NULL, "disasm malloc(%u) failed", size);
-    fail_unless(read(ref, d, size) == size, "disasm reference read failed");
-    fail_unless(read(fd, d + size, size) == size, "disasm read failed");
+    ck_assert_msg(d != NULL, "disasm malloc(%u) failed", size);
+    ck_assert_msg(read(ref, d, size) == size, "disasm reference read failed");
+    ck_assert_msg(read(fd, d + size, size) == size, "disasm read failed");
     close(fd);
     close(ref);
-    fail_unless(!memcmp(d, d + size, size), "disasm data doesn't match the reference");
+    ck_assert_msg(!memcmp(d, d + size, size), "disasm data doesn't match the reference");
     free(d);
     unlink(file);
 }
diff --git a/unit_tests/check_fpu_endian.c b/unit_tests/check_fpu_endian.c
index 2b2d63f..cdc443c 100644
--- a/unit_tests/check_fpu_endian.c
+++ b/unit_tests/check_fpu_endian.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2013 Sourcefire, Inc.
  *
  *  Authors: Steven Morgan <smorgan@sourcefire.com>
diff --git a/unit_tests/check_htmlnorm.c b/unit_tests/check_htmlnorm.c
index e51da0c..0a187d9 100644
--- a/unit_tests/check_htmlnorm.c
+++ b/unit_tests/check_htmlnorm.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for HTML normalizer;
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -39,7 +39,7 @@ static void htmlnorm_setup(void)
     cl_init(CL_INIT_DEFAULT);
     dconf_setup();
     dir = cli_gentemp(NULL);
-    fail_unless(!!dir, "cli_gentemp failed");
+    ck_assert_msg(!!dir, "cli_gentemp failed");
 }
 
 static void htmlnorm_teardown(void)
@@ -64,8 +64,6 @@ static struct test {
     {"input/htmlnorm_test.html", "test.nocomment.ref", "test.notags.ref", NULL},
     {"input/htmlnorm_urls.html", "urls.nocomment.ref", "urls.notags.ref", NULL}};
 
-#ifdef CHECK_HAVE_LOOPS
-
 static void check_dir(const char *dire, const struct test *test)
 {
     char filename[4096];
@@ -74,7 +72,7 @@ static void check_dir(const char *dire, const struct test *test)
     if (test->nocommentref) {
         snprintf(filename, sizeof(filename), "%s/nocomment.html", dire);
         fd = open(filename, O_RDONLY);
-        fail_unless(fd > 0, "unable to open: %s", filename);
+        ck_assert_msg(fd > 0, "unable to open: %s", filename);
         reffd = open_testfile(test->nocommentref);
 
         diff_files(fd, reffd);
@@ -85,7 +83,7 @@ static void check_dir(const char *dire, const struct test *test)
     if (test->notagsref) {
         snprintf(filename, sizeof(filename), "%s/notags.html", dire);
         fd = open(filename, O_RDONLY);
-        fail_unless(fd > 0, "unable to open: %s", filename);
+        ck_assert_msg(fd > 0, "unable to open: %s", filename);
         reffd = open_testfile(test->notagsref);
 
         diff_files(fd, reffd);
@@ -96,7 +94,7 @@ static void check_dir(const char *dire, const struct test *test)
     if (test->jsref) {
         snprintf(filename, sizeof(filename), "%s/javascript", dire);
         fd = open(filename, O_RDONLY);
-        fail_unless(fd > 0, "unable to open: %s", filename);
+        ck_assert_msg(fd > 0, "unable to open: %s", filename);
         reffd = open_testfile(test->jsref);
 
         diff_files(fd, reffd);
@@ -115,30 +113,30 @@ START_TEST(test_htmlnorm_api)
     memset(&hrefs, 0, sizeof(hrefs));
 
     fd = open_testfile(tests[_i].input);
-    fail_unless(fd > 0, "open_testfile failed");
+    ck_assert_msg(fd > 0, "open_testfile failed");
 
     map = fmap(fd, 0, 0);
-    fail_unless(!!map, "fmap failed");
+    ck_assert_msg(!!map, "fmap failed");
 
-    fail_unless(mkdir(dir, 0700) == 0, "mkdir failed");
-    fail_unless(html_normalise_map(map, dir, NULL, dconf) == 1, "html_normalise_map failed");
+    ck_assert_msg(mkdir(dir, 0700) == 0, "mkdir failed");
+    ck_assert_msg(html_normalise_map(map, dir, NULL, dconf) == 1, "html_normalise_map failed");
     check_dir(dir, &tests[_i]);
-    fail_unless(cli_rmdirs(dir) == 0, "rmdirs failed");
+    ck_assert_msg(cli_rmdirs(dir) == 0, "rmdirs failed");
 
-    fail_unless(mkdir(dir, 0700) == 0, "mkdir failed");
-    fail_unless(html_normalise_map(map, dir, NULL, NULL) == 1, "html_normalise_map failed");
-    fail_unless(cli_rmdirs(dir) == 0, "rmdirs failed");
+    ck_assert_msg(mkdir(dir, 0700) == 0, "mkdir failed");
+    ck_assert_msg(html_normalise_map(map, dir, NULL, NULL) == 1, "html_normalise_map failed");
+    ck_assert_msg(cli_rmdirs(dir) == 0, "rmdirs failed");
 
-    fail_unless(mkdir(dir, 0700) == 0, "mkdir failed");
-    fail_unless(html_normalise_map(map, dir, &hrefs, dconf) == 1, "html_normalise_map failed");
-    fail_unless(cli_rmdirs(dir) == 0, "rmdirs failed");
+    ck_assert_msg(mkdir(dir, 0700) == 0, "mkdir failed");
+    ck_assert_msg(html_normalise_map(map, dir, &hrefs, dconf) == 1, "html_normalise_map failed");
+    ck_assert_msg(cli_rmdirs(dir) == 0, "rmdirs failed");
     html_tag_arg_free(&hrefs);
 
     memset(&hrefs, 0, sizeof(hrefs));
     hrefs.scanContents = 1;
-    fail_unless(mkdir(dir, 0700) == 0, "mkdir failed");
-    fail_unless(html_normalise_map(map, dir, &hrefs, dconf) == 1, "html_normalise_map failed");
-    fail_unless(cli_rmdirs(dir) == 0, "rmdirs failed");
+    ck_assert_msg(mkdir(dir, 0700) == 0, "mkdir failed");
+    ck_assert_msg(html_normalise_map(map, dir, &hrefs, dconf) == 1, "html_normalise_map failed");
+    ck_assert_msg(cli_rmdirs(dir) == 0, "rmdirs failed");
     html_tag_arg_free(&hrefs);
 
     funmap(map);
@@ -146,19 +144,18 @@ START_TEST(test_htmlnorm_api)
     close(fd);
 }
 END_TEST
-#endif
 
 START_TEST(test_screnc_nullterminate)
 {
     int fd = open_testfile("input/screnc_test");
     fmap_t *map;
 
-    fail_unless(mkdir(dir, 0700) == 0, "mkdir failed");
+    ck_assert_msg(mkdir(dir, 0700) == 0, "mkdir failed");
     map = fmap(fd, 0, 0);
-    fail_unless(!!map, "fmap failed");
-    fail_unless(html_screnc_decode(map, dir) == 1, "html_screnc_decode failed");
+    ck_assert_msg(!!map, "fmap failed");
+    ck_assert_msg(html_screnc_decode(map, dir) == 1, "html_screnc_decode failed");
     funmap(map);
-    fail_unless(cli_rmdirs(dir) == 0, "rmdirs failed");
+    ck_assert_msg(cli_rmdirs(dir) == 0, "rmdirs failed");
     close(fd);
 }
 END_TEST
@@ -170,9 +167,9 @@ Suite *test_htmlnorm_suite(void)
 
     tc_htmlnorm_api = tcase_create("htmlnorm api");
     suite_add_tcase(s, tc_htmlnorm_api);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_htmlnorm_api, test_htmlnorm_api, 0, sizeof(tests) / sizeof(tests[0]));
-#endif
+
     tcase_add_unchecked_fixture(tc_htmlnorm_api,
                                 htmlnorm_setup, htmlnorm_teardown);
     tcase_add_test(tc_htmlnorm_api, test_screnc_nullterminate);
diff --git a/unit_tests/check_jsnorm.c b/unit_tests/check_jsnorm.c
index bda703d..5045b99 100644
--- a/unit_tests/check_jsnorm.c
+++ b/unit_tests/check_jsnorm.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for JS normalizer.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -61,14 +61,13 @@ static struct test op_test[] = {
     {"-", 1},
     {"---", 0}};
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(test_keywords)
 {
     const struct keyword *kw = in_word_set(kw_test[_i].str, strlen(kw_test[_i].str));
     if (kw_test[_i].is) {
-        fail_unless(kw && !strcmp(kw->name, kw_test[_i].str), "keyword mismatch");
+        ck_assert_msg(kw && !strcmp(kw->name, kw_test[_i].str), "keyword mismatch");
     } else {
-        fail_unless(!kw, "non-keyword detected as keyword");
+        ck_assert_msg(!kw, "non-keyword detected as keyword");
     }
 }
 END_TEST
@@ -77,12 +76,11 @@ START_TEST(test_operators)
 {
     const struct operator*op = in_op_set(op_test[_i].str, strlen(op_test[_i].str));
     if (op_test[_i].is)
-        fail_unless(op && !strcmp(op->name, op_test[_i].str), "operator mismatch");
+        ck_assert_msg(op && !strcmp(op->name, op_test[_i].str), "operator mismatch");
     else
-        fail_unless(!op, "non-operator detected as operator");
+        ck_assert_msg(!op, "non-operator detected as operator");
 }
 END_TEST
-#endif /* CHECK_HAVE_LOOPS */
 
 START_TEST(test_token_string)
 {
@@ -91,10 +89,10 @@ START_TEST(test_token_string)
     memset(&tok, 0, sizeof(tok));
 
     TOKEN_SET(&tok, string, str);
-    fail_unless(TOKEN_GET(&tok, string) == str, "token string get/set");
-    fail_unless(TOKEN_GET(&tok, cstring) == str, "token string->cstring");
-    fail_unless(TOKEN_GET(&tok, scope) == NULL, "token string->scope");
-    fail_unless(TOKEN_GET(&tok, ival) == -1, "token string->ival");
+    ck_assert_msg(TOKEN_GET(&tok, string) == str, "token string get/set");
+    ck_assert_msg(TOKEN_GET(&tok, cstring) == str, "token string->cstring");
+    ck_assert_msg(TOKEN_GET(&tok, scope) == NULL, "token string->scope");
+    ck_assert_msg(TOKEN_GET(&tok, ival) == -1, "token string->ival");
 }
 END_TEST
 
@@ -105,10 +103,10 @@ START_TEST(test_token_cstring)
     memset(&tok, 0, sizeof(tok));
 
     TOKEN_SET(&tok, cstring, str);
-    fail_unless(TOKEN_GET(&tok, string) == NULL, "token cstring->string");
-    fail_unless(TOKEN_GET(&tok, cstring) == str, "token string->cstring");
-    fail_unless(TOKEN_GET(&tok, scope) == NULL, "token string->scope");
-    fail_unless(TOKEN_GET(&tok, ival) == -1, "token string->ival");
+    ck_assert_msg(TOKEN_GET(&tok, string) == NULL, "token cstring->string");
+    ck_assert_msg(TOKEN_GET(&tok, cstring) == str, "token string->cstring");
+    ck_assert_msg(TOKEN_GET(&tok, scope) == NULL, "token string->scope");
+    ck_assert_msg(TOKEN_GET(&tok, ival) == -1, "token string->ival");
 }
 END_TEST
 
@@ -119,10 +117,10 @@ START_TEST(test_token_scope)
     memset(&tok, 0, sizeof(tok));
 
     TOKEN_SET(&tok, scope, sc);
-    fail_unless(TOKEN_GET(&tok, string) == NULL, "token scope->string");
-    fail_unless(TOKEN_GET(&tok, cstring) == NULL, "token scope->cstring");
-    fail_unless(TOKEN_GET(&tok, scope) == sc, "token scope->scope");
-    fail_unless(TOKEN_GET(&tok, ival) == -1, "token scope->ival");
+    ck_assert_msg(TOKEN_GET(&tok, string) == NULL, "token scope->string");
+    ck_assert_msg(TOKEN_GET(&tok, cstring) == NULL, "token scope->cstring");
+    ck_assert_msg(TOKEN_GET(&tok, scope) == sc, "token scope->scope");
+    ck_assert_msg(TOKEN_GET(&tok, ival) == -1, "token scope->ival");
 }
 END_TEST
 
@@ -133,11 +131,11 @@ START_TEST(test_token_ival)
     memset(&tok, 0, sizeof(tok));
 
     TOKEN_SET(&tok, ival, val);
-    fail_unless(TOKEN_GET(&tok, string) == NULL, "token ival->string");
-    fail_unless(TOKEN_GET(&tok, cstring) == NULL, "token ival->cstring");
-    fail_unless(TOKEN_GET(&tok, scope) == NULL, "token ival->scope");
-    fail_unless(TOKEN_GET(&tok, dval) - -1 < 1e-9, "token ival->dval");
-    fail_unless(TOKEN_GET(&tok, ival) == val, "token ival->ival");
+    ck_assert_msg(TOKEN_GET(&tok, string) == NULL, "token ival->string");
+    ck_assert_msg(TOKEN_GET(&tok, cstring) == NULL, "token ival->cstring");
+    ck_assert_msg(TOKEN_GET(&tok, scope) == NULL, "token ival->scope");
+    ck_assert_msg(TOKEN_GET(&tok, dval) - -1 < 1e-9, "token ival->dval");
+    ck_assert_msg(TOKEN_GET(&tok, ival) == val, "token ival->ival");
 }
 END_TEST
 
@@ -148,18 +146,18 @@ START_TEST(test_token_dval)
     memset(&tok, 0, sizeof(tok));
 
     TOKEN_SET(&tok, dval, val);
-    fail_unless(TOKEN_GET(&tok, string) == NULL, "token dval->string");
-    fail_unless(TOKEN_GET(&tok, cstring) == NULL, "token dval->cstring");
-    fail_unless(TOKEN_GET(&tok, scope) == NULL, "token dval->scope");
-    fail_unless(TOKEN_GET(&tok, dval) - val < 1e-9, "token dval->dval");
-    fail_unless(TOKEN_GET(&tok, ival) == -1, "token dval->ival");
+    ck_assert_msg(TOKEN_GET(&tok, string) == NULL, "token dval->string");
+    ck_assert_msg(TOKEN_GET(&tok, cstring) == NULL, "token dval->cstring");
+    ck_assert_msg(TOKEN_GET(&tok, scope) == NULL, "token dval->scope");
+    ck_assert_msg(TOKEN_GET(&tok, dval) - val < 1e-9, "token dval->dval");
+    ck_assert_msg(TOKEN_GET(&tok, ival) == -1, "token dval->ival");
 }
 END_TEST
 
 START_TEST(test_init_destroy)
 {
     struct parser_state *state = cli_js_init();
-    fail_unless(!!state, "cli_js_init()");
+    ck_assert_msg(!!state, "cli_js_init()");
     cli_js_destroy(state);
     cli_js_destroy(NULL);
 }
@@ -169,7 +167,7 @@ START_TEST(test_init_parse_destroy)
 {
     const char buf[]           = "function (p) { return \"anonymous\";}";
     struct parser_state *state = cli_js_init();
-    fail_unless(!!state, "cli_js_init()");
+    ck_assert_msg(!!state, "cli_js_init()");
     cli_js_process_buffer(state, buf, strlen(buf));
     cli_js_process_buffer(state, buf, strlen(buf));
     cli_js_parse_done(state);
@@ -187,7 +185,7 @@ START_TEST(js_begin_end)
         buf[p]   = ' ';
     }
     strncpy(buf + 8192, " stuff stuff <script language='javascript'> function () {}", 8192);
-    fail_unless(html_normalise_mem((unsigned char *)buf, sizeof(buf), NULL, NULL, dconf) == 1, "normalise");
+    ck_assert_msg(html_normalise_mem((unsigned char *)buf, sizeof(buf), NULL, NULL, dconf) == 1, "normalise");
 }
 END_TEST
 
@@ -197,8 +195,8 @@ START_TEST(multiple_scripts)
                  "<script language='Javascript'> function foo() {} </script>"
                  "<script language='Javascript'> function bar() {} </script>";
 
-    fail_unless(!!dconf, "failed to init dconf");
-    fail_unless(html_normalise_mem((unsigned char *)buf, sizeof(buf), NULL, NULL, dconf) == 1, "normalise");
+    ck_assert_msg(!!dconf, "failed to init dconf");
+    ck_assert_msg(html_normalise_mem((unsigned char *)buf, sizeof(buf), NULL, NULL, dconf) == 1, "normalise");
     /* TODO: test that both had been normalized */
 }
 END_TEST
@@ -210,10 +208,10 @@ static void jstest_setup(void)
 {
     cl_init(CL_INIT_DEFAULT);
     state = cli_js_init();
-    fail_unless(!!state, "js init");
+    ck_assert_msg(!!state, "js init");
     tmpdir = cli_gentemp(NULL);
-    fail_unless(!!tmpdir, "js tmp dir");
-    fail_unless_fmt(mkdir(tmpdir, 0700) == 0, "tempdir mkdir of %s failed: %s", tmpdir, strerror(errno));
+    ck_assert_msg(!!tmpdir, "js tmp dir");
+    ck_assert_msg(mkdir(tmpdir, 0700) == 0, "tempdir mkdir of %s failed: %s", tmpdir, strerror(errno));
 }
 
 static void jstest_teardown(void)
@@ -247,7 +245,7 @@ static void tokenizer_test(const char *in, const char *expected, int split)
     fd = open(filename, O_RDONLY);
     if (fd < 0) {
         jstest_teardown();
-        fail_fmt("failed to open output file: %s", filename);
+        ck_assert_msg("failed to open output file: %s", filename);
     }
 
     diff_file_mem(fd, expected, len);
@@ -378,7 +376,6 @@ static struct {
     {jstest_buf13, jstest_expected13},
     {jstest_buf14, jstest_expected14}};
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(tokenizer_basic)
 {
     tokenizer_test(js_tests[_i].in, js_tests[_i].expected, 0);
@@ -390,7 +387,6 @@ START_TEST(tokenizer_split)
     tokenizer_test(js_tests[_i].in, js_tests[_i].expected, 1);
 }
 END_TEST
-#endif /* CHECK_HAVE_LOOPS */
 
 START_TEST(js_buffer)
 {
@@ -402,8 +398,8 @@ START_TEST(js_buffer)
     char *tst          = malloc(len);
     char *exp          = malloc(len + sizeof(s_exp) + sizeof(e_exp) - 2);
 
-    fail_unless(!!tst, "malloc");
-    fail_unless(!!exp, "malloc");
+    ck_assert_msg(!!tst, "malloc");
+    ck_assert_msg(!!exp, "malloc");
 
     memset(tst, 'a', len);
     strncpy(tst, s, strlen(s));
@@ -424,7 +420,7 @@ START_TEST(screnc_infloop)
     char buf[24700] = "<%@ language='jscript.encode'>";
     size_t p;
 
-    fail_unless(!!dconf, "failed to init dconf");
+    ck_assert_msg(!!dconf, "failed to init dconf");
     for (p = strlen(buf); p < 16384; p++) {
         buf[p] = ' ';
     }
@@ -432,7 +428,7 @@ START_TEST(screnc_infloop)
         buf[p] = 'a';
     }
     strncpy(buf + 24626, "#@~^ ", 10);
-    fail_unless(html_normalise_mem((unsigned char *)buf, sizeof(buf), NULL, NULL, dconf) == 1, "normalise");
+    ck_assert_msg(html_normalise_mem((unsigned char *)buf, sizeof(buf), NULL, NULL, dconf) == 1, "normalise");
 }
 END_TEST
 
@@ -464,10 +460,10 @@ Suite *test_jsnorm_suite(void)
     prepare();
     tc_jsnorm_gperf = tcase_create("jsnorm gperf");
     suite_add_tcase(s, tc_jsnorm_gperf);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_jsnorm_gperf, test_keywords, 0, sizeof(kw_test) / sizeof(kw_test[0]));
     tcase_add_loop_test(tc_jsnorm_gperf, test_operators, 0, sizeof(op_test) / sizeof(op_test[0]));
-#endif
+
     tc_jsnorm_token = tcase_create("jsnorm token functions");
     suite_add_tcase(s, tc_jsnorm_token);
     tcase_add_test(tc_jsnorm_token, test_token_string);
@@ -484,10 +480,10 @@ Suite *test_jsnorm_suite(void)
     tc_jsnorm_tokenizer = tcase_create("jsnorm tokenizer");
     suite_add_tcase(s, tc_jsnorm_tokenizer);
     tcase_add_checked_fixture(tc_jsnorm_tokenizer, jstest_setup, jstest_teardown);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_jsnorm_tokenizer, tokenizer_basic, 0, sizeof(js_tests) / sizeof(js_tests[0]));
     tcase_add_loop_test(tc_jsnorm_tokenizer, tokenizer_split, 0, sizeof(js_tests) / sizeof(js_tests[0]));
-#endif
+
     tcase_add_test(tc_jsnorm_tokenizer, js_buffer);
 
     tc_jsnorm_bugs = tcase_create("bugs");
diff --git a/unit_tests/check_matchers.c b/unit_tests/check_matchers.c
index 3c78b17..267f530 100644
--- a/unit_tests/check_matchers.c
+++ b/unit_tests/check_matchers.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Tomasz Kojm
@@ -169,9 +169,9 @@ static void setup(void)
     ctx.virname = &virname;
     ctx.fmap    = &thefmap;
     ctx.engine  = cl_engine_new();
-    fail_unless(!!ctx.engine, "cl_engine_new() failed");
+    ck_assert_msg(!!ctx.engine, "cl_engine_new() failed");
     root = (struct cli_matcher *)MPOOL_CALLOC(ctx.engine->mempool, 1, sizeof(struct cli_matcher));
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
 #ifdef USE_MPOOL
     root->mempool = ctx.engine->mempool;
 #endif
@@ -192,35 +192,35 @@ START_TEST(test_ac_scanbuff)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
     root->ac_only = 1;
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_ac_init(root, CLI_DEFAULT_AC_MINDEPTH, CLI_DEFAULT_AC_MAXDEPTH, 1);
-    fail_unless(ret == CL_SUCCESS, "cli_ac_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_ac_init() failed");
 
     for (i = 0; ac_testdata[i].data; i++) {
         ret = cli_parse_add(root, ac_testdata[i].virname, ac_testdata[i].hexsig, 0, 0, 0, "*", 0, NULL, 0);
-        fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+        ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
     }
 
     ret = cli_ac_buildtrie(root);
-    fail_unless(ret == CL_SUCCESS, "cli_ac_buildtrie() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_ac_buildtrie() failed");
 
     ret = cli_ac_initdata(&mdata, root->ac_partsigs, 0, 0, CLI_DEFAULT_AC_TRACKLEN);
-    fail_unless(ret == CL_SUCCESS, "cli_ac_initdata() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_ac_initdata() failed");
 
     ctx.options->general &= ~CL_SCAN_GENERAL_ALLMATCHES; /* make sure all-match is disabled */
     for (i = 0; ac_testdata[i].data; i++) {
         ret = cli_ac_scanbuff((const unsigned char *)ac_testdata[i].data, strlen(ac_testdata[i].data), &virname, NULL, NULL, root, &mdata, 0, 0, NULL, AC_SCAN_VIR, NULL);
-        fail_unless_fmt(ret == CL_VIRUS, "cli_ac_scanbuff() failed for %s", ac_testdata[i].virname);
-        fail_unless_fmt(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
+        ck_assert_msg(ret == CL_VIRUS, "cli_ac_scanbuff() failed for %s", ac_testdata[i].virname);
+        ck_assert_msg(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
 
         ret = cli_scanbuff((const unsigned char *)ac_testdata[i].data, strlen(ac_testdata[i].data), 0, &ctx, 0, NULL);
-        fail_unless_fmt(ret == CL_VIRUS, "cli_scanbuff() failed for %s", ac_testdata[i].virname);
-        fail_unless_fmt(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
+        ck_assert_msg(ret == CL_VIRUS, "cli_scanbuff() failed for %s", ac_testdata[i].virname);
+        ck_assert_msg(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
     }
 
     cli_ac_freedata(&mdata);
@@ -235,35 +235,35 @@ START_TEST(test_ac_scanbuff_allscan)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
     root->ac_only = 1;
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_ac_init(root, CLI_DEFAULT_AC_MINDEPTH, CLI_DEFAULT_AC_MAXDEPTH, 1);
-    fail_unless(ret == CL_SUCCESS, "cli_ac_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_ac_init() failed");
 
     for (i = 0; ac_testdata[i].data; i++) {
         ret = cli_parse_add(root, ac_testdata[i].virname, ac_testdata[i].hexsig, 0, 0, 0, "*", 0, NULL, 0);
-        fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+        ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
     }
 
     ret = cli_ac_buildtrie(root);
-    fail_unless(ret == CL_SUCCESS, "cli_ac_buildtrie() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_ac_buildtrie() failed");
 
     ret = cli_ac_initdata(&mdata, root->ac_partsigs, 0, 0, CLI_DEFAULT_AC_TRACKLEN);
-    fail_unless(ret == CL_SUCCESS, "cli_ac_initdata() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_ac_initdata() failed");
 
     ctx.options->general |= CL_SCAN_GENERAL_ALLMATCHES; /* enable all-match */
     for (i = 0; ac_testdata[i].data; i++) {
         ret = cli_ac_scanbuff((const unsigned char *)ac_testdata[i].data, strlen(ac_testdata[i].data), &virname, NULL, NULL, root, &mdata, 0, 0, NULL, AC_SCAN_VIR, NULL);
-        fail_unless_fmt(ret == CL_VIRUS, "cli_ac_scanbuff() failed for %s", ac_testdata[i].virname);
-        fail_unless_fmt(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
+        ck_assert_msg(ret == CL_VIRUS, "cli_ac_scanbuff() failed for %s", ac_testdata[i].virname);
+        ck_assert_msg(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
 
         ret = cli_scanbuff((const unsigned char *)ac_testdata[i].data, strlen(ac_testdata[i].data), 0, &ctx, 0, NULL);
-        fail_unless_fmt(ret == CL_VIRUS, "cli_scanbuff() failed for %s", ac_testdata[i].virname);
-        fail_unless_fmt(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
+        ck_assert_msg(ret == CL_VIRUS, "cli_scanbuff() failed for %s", ac_testdata[i].virname);
+        ck_assert_msg(!strncmp(virname, ac_testdata[i].virname, strlen(ac_testdata[i].virname)), "Dataset %u matched with %s", i, virname);
         if (ctx.num_viruses)
             ctx.num_viruses = 0;
     }
@@ -280,35 +280,35 @@ START_TEST(test_ac_scanbuff_ex)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
     root->ac_only = 1;
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_ac_init(root, CLI_DEFAULT_AC_MINDEPTH, CLI_DEFAULT_AC_MAXDEPTH, 1);
-    fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_ac_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_ac_init() failed");
 
     for (i = 0; ac_sigopts_testdata[i].data; i++) {
         ret = cli_sigopts_handler(root, ac_sigopts_testdata[i].virname, ac_sigopts_testdata[i].hexsig, ac_sigopts_testdata[i].sigopts, 0, 0, ac_sigopts_testdata[i].offset, 0, NULL, 0);
-        fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_sigopts_handler() failed");
+        ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_sigopts_handler() failed");
     }
 
     ret = cli_ac_buildtrie(root);
-    fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_ac_buildtrie() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_ac_buildtrie() failed");
 
     ret = cli_ac_initdata(&mdata, root->ac_partsigs, 0, 0, CLI_DEFAULT_AC_TRACKLEN);
-    fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_ac_initdata() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_ac_initdata() failed");
 
     ctx.options->general &= ~CL_SCAN_GENERAL_ALLMATCHES; /* make sure all-match is disabled */
     for (i = 0; ac_sigopts_testdata[i].data; i++) {
         ret = cli_ac_scanbuff((const unsigned char *)ac_sigopts_testdata[i].data, ac_sigopts_testdata[i].dlength, &virname, NULL, NULL, root, &mdata, 0, 0, NULL, AC_SCAN_VIR, NULL);
-        fail_unless_fmt(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
+        ck_assert_msg(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
         if (ac_sigopts_testdata[i].expected_result == CL_VIRUS)
-            fail_unless_fmt(!strncmp(virname, ac_sigopts_testdata[i].virname, strlen(ac_sigopts_testdata[i].virname)), "[ac_ex] Dataset %u matched with %s", i, virname);
+            ck_assert_msg(!strncmp(virname, ac_sigopts_testdata[i].virname, strlen(ac_sigopts_testdata[i].virname)), "[ac_ex] Dataset %u matched with %s", i, virname);
 
         ret = cli_scanbuff((const unsigned char *)ac_sigopts_testdata[i].data, ac_sigopts_testdata[i].dlength, 0, &ctx, 0, NULL);
-        fail_unless_fmt(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
+        ck_assert_msg(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
     }
 
     cli_ac_freedata(&mdata);
@@ -323,35 +323,35 @@ START_TEST(test_ac_scanbuff_allscan_ex)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
     root->ac_only = 1;
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_ac_init(root, CLI_DEFAULT_AC_MINDEPTH, CLI_DEFAULT_AC_MAXDEPTH, 1);
-    fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_ac_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_ac_init() failed");
 
     for (i = 0; ac_sigopts_testdata[i].data; i++) {
         ret = cli_sigopts_handler(root, ac_sigopts_testdata[i].virname, ac_sigopts_testdata[i].hexsig, ac_sigopts_testdata[i].sigopts, 0, 0, ac_sigopts_testdata[i].offset, 0, NULL, 0);
-        fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_sigopts_handler() failed");
+        ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_sigopts_handler() failed");
     }
 
     ret = cli_ac_buildtrie(root);
-    fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_ac_buildtrie() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_ac_buildtrie() failed");
 
     ret = cli_ac_initdata(&mdata, root->ac_partsigs, 0, 0, CLI_DEFAULT_AC_TRACKLEN);
-    fail_unless(ret == CL_SUCCESS, "[ac_ex] cli_ac_initdata() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[ac_ex] cli_ac_initdata() failed");
 
     ctx.options->general |= CL_SCAN_GENERAL_ALLMATCHES; /* enable all-match */
     for (i = 0; ac_sigopts_testdata[i].data; i++) {
         ret = cli_ac_scanbuff((const unsigned char *)ac_sigopts_testdata[i].data, ac_sigopts_testdata[i].dlength, &virname, NULL, NULL, root, &mdata, 0, 0, NULL, AC_SCAN_VIR, NULL);
-        fail_unless_fmt(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
+        ck_assert_msg(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
         if (ac_sigopts_testdata[i].expected_result == CL_VIRUS)
-            fail_unless_fmt(!strncmp(virname, ac_sigopts_testdata[i].virname, strlen(ac_sigopts_testdata[i].virname)), "[ac_ex] Dataset %u matched with %s", i, virname);
+            ck_assert_msg(!strncmp(virname, ac_sigopts_testdata[i].virname, strlen(ac_sigopts_testdata[i].virname)), "[ac_ex] Dataset %u matched with %s", i, virname);
 
         ret = cli_scanbuff((const unsigned char *)ac_sigopts_testdata[i].data, ac_sigopts_testdata[i].dlength, 0, &ctx, 0, NULL);
-        fail_unless_fmt(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
+        ck_assert_msg(ret == ac_sigopts_testdata[i].expected_result, "[ac_ex] cli_ac_scanbuff() failed for %s (%d != %d)", ac_sigopts_testdata[i].virname, ret, ac_sigopts_testdata[i].expected_result);
         if (ctx.num_viruses)
             ctx.num_viruses = 0;
     }
@@ -367,25 +367,25 @@ START_TEST(test_bm_scanbuff)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_bm_init(root);
-    fail_unless(ret == CL_SUCCESS, "cli_bm_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_bm_init() failed");
 
     ret = cli_parse_add(root, "Sig1", "deadbabe", 0, 0, 0, "*", 0, NULL, 0);
-    fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
     ret = cli_parse_add(root, "Sig2", "deadbeef", 0, 0, 0, "*", 0, NULL, 0);
-    fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
     ret = cli_parse_add(root, "Sig3", "babedead", 0, 0, 0, "*", 0, NULL, 0);
-    fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
 
     ctx.options->general &= ~CL_SCAN_GENERAL_ALLMATCHES; /* make sure all-match is disabled */
     ret = cli_bm_scanbuff((const unsigned char *)"blah\xde\xad\xbe\xef", 12, &virname, NULL, root, 0, NULL, NULL, NULL);
-    fail_unless(ret == CL_VIRUS, "cli_bm_scanbuff() failed");
-    fail_unless(!strncmp(virname, "Sig2", 4), "Incorrect signature matched in cli_bm_scanbuff()\n");
+    ck_assert_msg(ret == CL_VIRUS, "cli_bm_scanbuff() failed");
+    ck_assert_msg(!strncmp(virname, "Sig2", 4), "Incorrect signature matched in cli_bm_scanbuff()\n");
 }
 END_TEST
 
@@ -396,25 +396,25 @@ START_TEST(test_bm_scanbuff_allscan)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_bm_init(root);
-    fail_unless(ret == CL_SUCCESS, "cli_bm_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_bm_init() failed");
 
     ret = cli_parse_add(root, "Sig1", "deadbabe", 0, 0, 0, "*", 0, NULL, 0);
-    fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
     ret = cli_parse_add(root, "Sig2", "deadbeef", 0, 0, 0, "*", 0, NULL, 0);
-    fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
     ret = cli_parse_add(root, "Sig3", "babedead", 0, 0, 0, "*", 0, NULL, 0);
-    fail_unless(ret == CL_SUCCESS, "cli_parse_add() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "cli_parse_add() failed");
 
     ctx.options->general |= CL_SCAN_GENERAL_ALLMATCHES; /* enable all-match */
     ret = cli_bm_scanbuff((const unsigned char *)"blah\xde\xad\xbe\xef", 12, &virname, NULL, root, 0, NULL, NULL, NULL);
-    fail_unless(ret == CL_VIRUS, "cli_bm_scanbuff() failed");
-    fail_unless(!strncmp(virname, "Sig2", 4), "Incorrect signature matched in cli_bm_scanbuff()\n");
+    ck_assert_msg(ret == CL_VIRUS, "cli_bm_scanbuff() failed");
+    ck_assert_msg(!strncmp(virname, "Sig2", 4), "Incorrect signature matched in cli_bm_scanbuff()\n");
 }
 END_TEST
 
@@ -429,45 +429,45 @@ START_TEST(test_pcre_scanbuff)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_pcre_init();
-    fail_unless(ret == CL_SUCCESS, "[pcre] cli_pcre_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_pcre_init() failed");
 
     for (i = 0; pcre_testdata[i].data; i++) {
         hexlen = strlen(PCRE_BYPASS) + strlen(pcre_testdata[i].hexsig) + 1;
 
         hexsig = cli_calloc(hexlen, sizeof(char));
-        fail_unless(hexsig != NULL, "[pcre] failed to prepend bypass (out-of-memory)");
+        ck_assert_msg(hexsig != NULL, "[pcre] failed to prepend bypass (out-of-memory)");
 
         strncat(hexsig, PCRE_BYPASS, hexlen);
         strncat(hexsig, pcre_testdata[i].hexsig, hexlen);
 
         ret = cli_parse_add(root, pcre_testdata[i].virname, hexsig, pcre_testdata[i].sigopts, 0, 0, pcre_testdata[i].offset, 0, NULL, 0);
-        fail_unless(ret == CL_SUCCESS, "[pcre] cli_parse_add() failed");
+        ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_parse_add() failed");
         free(hexsig);
     }
 
     ret = cli_pcre_build(root, CLI_DEFAULT_PCRE_MATCH_LIMIT, CLI_DEFAULT_PCRE_RECMATCH_LIMIT, NULL);
-    fail_unless(ret == CL_SUCCESS, "[pcre] cli_pcre_build() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_pcre_build() failed");
 
     // recomputate offsets
 
     ret = cli_ac_initdata(&mdata, root->ac_partsigs, root->ac_lsigs, root->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN);
-    fail_unless(ret == CL_SUCCESS, "[pcre] cli_ac_initdata() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_ac_initdata() failed");
 
     ctx.options->general &= ~CL_SCAN_GENERAL_ALLMATCHES; /* make sure all-match is disabled */
     for (i = 0; pcre_testdata[i].data; i++) {
         ret = cli_pcre_scanbuf((const unsigned char *)pcre_testdata[i].data, strlen(pcre_testdata[i].data), &virname, NULL, root, NULL, NULL, NULL);
-        fail_unless_fmt(ret == pcre_testdata[i].expected_result, "[pcre] cli_pcre_scanbuff() failed for %s (%d != %d)", pcre_testdata[i].virname, ret, pcre_testdata[i].expected_result);
+        ck_assert_msg(ret == pcre_testdata[i].expected_result, "[pcre] cli_pcre_scanbuff() failed for %s (%d != %d)", pcre_testdata[i].virname, ret, pcre_testdata[i].expected_result);
         if (pcre_testdata[i].expected_result == CL_VIRUS)
-            fail_unless_fmt(!strncmp(virname, pcre_testdata[i].virname, strlen(pcre_testdata[i].virname)), "[pcre] Dataset %u matched with %s", i, virname);
+            ck_assert_msg(!strncmp(virname, pcre_testdata[i].virname, strlen(pcre_testdata[i].virname)), "[pcre] Dataset %u matched with %s", i, virname);
 
         ret = cli_scanbuff((const unsigned char *)pcre_testdata[i].data, strlen(pcre_testdata[i].data), 0, &ctx, 0, NULL);
-        fail_unless_fmt(ret == pcre_testdata[i].expected_result, "[pcre] cli_scanbuff() failed for %s", pcre_testdata[i].virname);
+        ck_assert_msg(ret == pcre_testdata[i].expected_result, "[pcre] cli_scanbuff() failed for %s", pcre_testdata[i].virname);
     }
 
     cli_ac_freedata(&mdata);
@@ -483,45 +483,45 @@ START_TEST(test_pcre_scanbuff_allscan)
     int ret;
 
     root = ctx.engine->root[0];
-    fail_unless(root != NULL, "root == NULL");
+    ck_assert_msg(root != NULL, "root == NULL");
 
 #ifdef USE_MPOOL
     root->mempool = mpool_create();
 #endif
     ret = cli_pcre_init();
-    fail_unless(ret == CL_SUCCESS, "[pcre] cli_pcre_init() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_pcre_init() failed");
 
     for (i = 0; pcre_testdata[i].data; i++) {
         hexlen = strlen(PCRE_BYPASS) + strlen(pcre_testdata[i].hexsig) + 1;
 
         hexsig = cli_calloc(hexlen, sizeof(char));
-        fail_unless(hexsig != NULL, "[pcre] failed to prepend bypass (out-of-memory)");
+        ck_assert_msg(hexsig != NULL, "[pcre] failed to prepend bypass (out-of-memory)");
 
         strncat(hexsig, PCRE_BYPASS, hexlen);
         strncat(hexsig, pcre_testdata[i].hexsig, hexlen);
 
         ret = cli_parse_add(root, pcre_testdata[i].virname, hexsig, 0, 0, 0, pcre_testdata[i].offset, 0, NULL, 0);
-        fail_unless(ret == CL_SUCCESS, "[pcre] cli_parse_add() failed");
+        ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_parse_add() failed");
         free(hexsig);
     }
 
     ret = cli_pcre_build(root, CLI_DEFAULT_PCRE_MATCH_LIMIT, CLI_DEFAULT_PCRE_RECMATCH_LIMIT, NULL);
-    fail_unless(ret == CL_SUCCESS, "[pcre] cli_pcre_build() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_pcre_build() failed");
 
     // recomputate offsets
 
     ret = cli_ac_initdata(&mdata, root->ac_partsigs, root->ac_lsigs, root->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN);
-    fail_unless(ret == CL_SUCCESS, "[pcre] cli_ac_initdata() failed");
+    ck_assert_msg(ret == CL_SUCCESS, "[pcre] cli_ac_initdata() failed");
 
     ctx.options->general |= CL_SCAN_GENERAL_ALLMATCHES; /* enable all-match */
     for (i = 0; pcre_testdata[i].data; i++) {
         ret = cli_pcre_scanbuf((const unsigned char *)pcre_testdata[i].data, strlen(pcre_testdata[i].data), &virname, NULL, root, NULL, NULL, NULL);
-        fail_unless_fmt(ret == pcre_testdata[i].expected_result, "[pcre] cli_pcre_scanbuff() failed for %s (%d != %d)", pcre_testdata[i].virname, ret, pcre_testdata[i].expected_result);
+        ck_assert_msg(ret == pcre_testdata[i].expected_result, "[pcre] cli_pcre_scanbuff() failed for %s (%d != %d)", pcre_testdata[i].virname, ret, pcre_testdata[i].expected_result);
         if (pcre_testdata[i].expected_result == CL_VIRUS)
-            fail_unless_fmt(!strncmp(virname, pcre_testdata[i].virname, strlen(pcre_testdata[i].virname)), "[pcre] Dataset %u matched with %s", i, virname);
+            ck_assert_msg(!strncmp(virname, pcre_testdata[i].virname, strlen(pcre_testdata[i].virname)), "[pcre] Dataset %u matched with %s", i, virname);
 
         ret = cli_scanbuff((const unsigned char *)pcre_testdata[i].data, strlen(pcre_testdata[i].data), 0, &ctx, 0, NULL);
-        fail_unless_fmt(ret == pcre_testdata[i].expected_result, "[pcre] cli_scanbuff() failed for %s", pcre_testdata[i].virname);
+        ck_assert_msg(ret == pcre_testdata[i].expected_result, "[pcre] cli_scanbuff() failed for %s", pcre_testdata[i].virname);
         /* num_virus field add to test case struct */
         if (ctx.num_viruses)
             ctx.num_viruses = 0;
diff --git a/unit_tests/check_regex.c b/unit_tests/check_regex.c
index 4a1a3be..8de69ec 100644
--- a/unit_tests/check_regex.c
+++ b/unit_tests/check_regex.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for regular expression processing.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -46,7 +46,7 @@ static size_t cb_called = 0;
 
 static cl_error_t cb_fail(void *cbdata, const char *suffix, size_t len, const struct regex_list *regex)
 {
-    fail("this pattern is not supposed to have a suffix");
+    ck_abort_msg("this pattern is not supposed to have a suffix");
     return CL_EMEM;
 }
 
@@ -54,7 +54,7 @@ static cl_error_t cb_expect_single(void *cbdata, const char *suffix, size_t len,
 {
     const char *expected = cbdata;
     cb_called++;
-    fail_unless_fmt(suffix && strcmp(suffix, expected) == 0,
+    ck_assert_msg(suffix && strcmp(suffix, expected) == 0,
                     "suffix mismatch, was: %s, expected: %s\n", suffix, expected);
     return CL_SUCCESS;
 }
@@ -68,11 +68,11 @@ START_TEST(empty)
 
     errmsg_expected();
     preg = malloc(sizeof(*regex.preg));
-    fail_unless(!!preg, "malloc");
+    ck_assert_msg(!!preg, "malloc");
     rc = cli_regex2suffix(pattern, preg, cb_fail, NULL);
     free(preg);
-    fail_unless(rc == REG_EMPTY, "empty pattern");
-    fail_unless(cb_called == 0, "callback shouldn't be called");
+    ck_assert_msg(rc == REG_EMPTY, "empty pattern");
+    ck_assert_msg(cb_called == 0, "callback shouldn't be called");
 }
 END_TEST
 
@@ -83,12 +83,12 @@ START_TEST(one)
     regex_t *preg;
 
     preg = malloc(sizeof(*regex.preg));
-    fail_unless(!!preg, "malloc");
+    ck_assert_msg(!!preg, "malloc");
     rc = cli_regex2suffix(pattern, preg, cb_expect_single, pattern);
-    fail_unless(rc == 0, "single character pattern");
+    ck_assert_msg(rc == 0, "single character pattern");
     cli_regfree(preg);
     free(preg);
-    fail_unless(cb_called == 1, "callback should be called once");
+    ck_assert_msg(cb_called == 1, "callback should be called once");
 }
 END_TEST
 
@@ -104,18 +104,17 @@ static const char **tests[] = {
 static cl_error_t cb_expect_multi(void *cbdata, const char *suffix, size_t len, const struct regex_list *r)
 {
     const char **exp = cbdata;
-    fail_unless(!!exp, "expected data");
+    ck_assert_msg(!!exp, "expected data");
     exp++;
-    fail_unless_fmt(!!*exp, "expected no suffix, got: %s\n", suffix);
-    fail_unless_fmt(!!exp[cb_called], "expected less suffixes, but already got: %d\n", cb_called);
-    fail_unless_fmt(strcmp(exp[cb_called], suffix) == 0,
+    ck_assert_msg(!!*exp, "expected no suffix, got: %s\n", suffix);
+    ck_assert_msg(!!exp[cb_called], "expected less suffixes, but already got: %d\n", cb_called);
+    ck_assert_msg(strcmp(exp[cb_called], suffix) == 0,
                     "suffix mismatch, was: %s, expected: %s\n", suffix, exp[cb_called]);
-    fail_unless_fmt(strlen(suffix) == len, "incorrect suffix len, expected: %d, got: %d\n", strlen(suffix), len);
+    ck_assert_msg(strlen(suffix) == len, "incorrect suffix len, expected: %d, got: %d\n", strlen(suffix), len);
     cb_called++;
     return CL_SUCCESS;
 }
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(test_suffix)
 {
     int rc;
@@ -124,20 +123,19 @@ START_TEST(test_suffix)
     size_t n            = 0;
     const char **p      = tests[_i];
 
-    fail_unless(!!pattern, "test pattern");
+    ck_assert_msg(!!pattern, "test pattern");
     preg = malloc(sizeof(*regex.preg));
-    fail_unless(!!preg, "malloc");
+    ck_assert_msg(!!preg, "malloc");
     rc = cli_regex2suffix(pattern, preg, cb_expect_multi, tests[_i]);
-    fail_unless(rc == 0, "single character pattern");
+    ck_assert_msg(rc == 0, "single character pattern");
     cli_regfree(preg);
     free(preg);
     p++;
     while (*p++) n++;
-    fail_unless_fmt(cb_called == n,
+    ck_assert_msg(cb_called == n,
                     "suffix number mismatch, expected: %d, was: %d\n", n, cb_called);
 }
 END_TEST
-#endif /* CHECK_HAVE_LOOPS */
 
 static void setup(void)
 {
@@ -157,7 +155,7 @@ static void rsetup(void)
     matcher.mempool = mpool_create();
 #endif
     rc = init_regex_list(&matcher, 1);
-    fail_unless(rc == 0, "init_regex_list");
+    ck_assert_msg(rc == 0, "init_regex_list");
 }
 
 static void rteardown(void)
@@ -231,7 +229,6 @@ static const struct rtest {
     {NULL, "http://key.com%00fake.example.com";, "https://key.com";, 0},
     {NULL, "http://key.com.example.com";, "key.com.invalid", 0}};
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(regex_list_match_test)
 {
     const char *info;
@@ -240,42 +237,41 @@ START_TEST(regex_list_match_test)
     int rc;
 
     if (!rtest->pattern) {
-        fail_unless(rtest->result != 1,
+        ck_assert_msg(rtest->result != 1,
                     "whitelist test must have pattern set");
         /* this test entry is not meant for whitelist testing */
         return;
     }
 
-    fail_unless(rtest->result == 0 || rtest->result == 1 || rtest->result == 4,
+    ck_assert_msg(rtest->result == 0 || rtest->result == 1 || rtest->result == 4,
                 "whitelist test result must be either 0 or 1 or 4");
     pattern = cli_strdup(rtest->pattern);
-    fail_unless(!!pattern, "cli_strdup");
+    ck_assert_msg(!!pattern, "cli_strdup");
 
     rc = regex_list_add_pattern(&matcher, pattern);
     if (rtest->result == 4) {
-        fail_unless(rc, "regex_list_add_pattern should return error");
+        ck_assert_msg(rc, "regex_list_add_pattern should return error");
         free(pattern);
         return;
     } else
-        fail_unless(rc == 0, "regex_list_add_pattern");
+        ck_assert_msg(rc == 0, "regex_list_add_pattern");
     free(pattern);
 
     matcher.list_loaded = 1;
 
     rc = cli_build_regex_list(&matcher);
-    fail_unless(rc == 0, "cli_build_regex_list");
+    ck_assert_msg(rc == 0, "cli_build_regex_list");
 
-    fail_unless(is_regex_ok(&matcher), "is_regex_ok");
+    ck_assert_msg(is_regex_ok(&matcher), "is_regex_ok");
 
     realurl = cli_strdup(rtest->realurl);
     rc      = regex_list_match(&matcher, realurl, rtest->displayurl, NULL, 1, &info, 1);
-    fail_unless(rc == rtest->result, "regex_list_match");
+    ck_assert_msg(rc == rtest->result, "regex_list_match");
     /* regex_list_match is not supposed to modify realurl in this case */
-    fail_unless(!strcmp(realurl, rtest->realurl), "realurl altered");
+    ck_assert_msg(!strcmp(realurl, rtest->realurl), "realurl altered");
     free(realurl);
 }
 END_TEST
-#endif /* CHECK_HAVE_LOOPS */
 
 static struct cl_engine *engine;
 static int loaded_2 = 0;
@@ -287,55 +283,55 @@ static void psetup_impl(int load2)
     unsigned signo = 0;
 
     engine = cl_engine_new();
-    fail_unless(!!engine, "cl_engine_new");
+    ck_assert_msg(!!engine, "cl_engine_new");
 
     phishing_init(engine);
-    fail_unless(!!engine->phishcheck, "phishing_init");
+    ck_assert_msg(!!engine->phishcheck, "phishing_init");
 
     rc = init_domainlist(engine);
-    fail_unless(rc == 0, "init_domainlist");
+    ck_assert_msg(rc == 0, "init_domainlist");
 
     f = fdopen(open_testfile("input/daily.pdb"), "r");
-    fail_unless(!!f, "fopen daily.pdb");
+    ck_assert_msg(!!f, "fopen daily.pdb");
 
     rc = load_regex_matcher(engine, engine->domainlist_matcher, f, &signo, 0, 0, NULL, 1);
-    fail_unless(rc == 0, "load_regex_matcher");
+    ck_assert_msg(rc == 0, "load_regex_matcher");
     fclose(f);
 
-    fail_unless_fmt(signo == 201, "Incorrect number of signatures: %u, expected %u", signo, 201);
+    ck_assert_msg(signo == 201, "Incorrect number of signatures: %u, expected %u", signo, 201);
 
     if (load2) {
         f = fdopen(open_testfile("input/daily.gdb"), "r");
-        fail_unless(!!f, "fopen daily.gdb");
+        ck_assert_msg(!!f, "fopen daily.gdb");
 
         signo = 0;
         rc    = load_regex_matcher(engine, engine->domainlist_matcher, f, &signo, 0, 0, NULL, 1);
-        fail_unless(rc == 0, "load_regex_matcher");
+        ck_assert_msg(rc == 0, "load_regex_matcher");
         fclose(f);
 
-        fail_unless_fmt(signo == 4, "Incorrect number of signatures: %u, expected %u", signo, 4);
+        ck_assert_msg(signo == 4, "Incorrect number of signatures: %u, expected %u", signo, 4);
     }
     loaded_2 = load2;
 
     rc = init_whitelist(engine);
-    fail_unless(rc == 0, "init_whitelist");
+    ck_assert_msg(rc == 0, "init_whitelist");
 
     f     = fdopen(open_testfile("input/daily.wdb"), "r");
     signo = 0;
     rc    = load_regex_matcher(engine, engine->whitelist_matcher, f, &signo, 0, 1, NULL, 1);
-    fail_unless(rc == 0, "load_regex_matcher");
+    ck_assert_msg(rc == 0, "load_regex_matcher");
     fclose(f);
 
-    fail_unless_fmt(signo == 31, "Incorrect number of signatures: %u, expected %u", signo, 31);
+    ck_assert_msg(signo == 31, "Incorrect number of signatures: %u, expected %u", signo, 31);
 
     rc = cli_build_regex_list(engine->whitelist_matcher);
-    fail_unless(rc == 0, "cli_build_regex_list");
+    ck_assert_msg(rc == 0, "cli_build_regex_list");
 
     rc = cli_build_regex_list(engine->domainlist_matcher);
-    fail_unless(rc == 0, "cli_build_regex_list");
+    ck_assert_msg(rc == 0, "cli_build_regex_list");
 
-    fail_unless(is_regex_ok(engine->whitelist_matcher), "is_regex_ok");
-    fail_unless(is_regex_ok(engine->domainlist_matcher), "is_regex_ok");
+    ck_assert_msg(is_regex_ok(engine->whitelist_matcher), "is_regex_ok");
+    ck_assert_msg(is_regex_ok(engine->domainlist_matcher), "is_regex_ok");
 }
 
 static void psetup(void)
@@ -370,16 +366,16 @@ static void do_phishing_test(const struct rtest *rtest)
     ctx.options = &options;
 
     realurl = cli_strdup(rtest->realurl);
-    fail_unless(!!realurl, "cli_strdup");
+    ck_assert_msg(!!realurl, "cli_strdup");
 
     hrefs.count = 1;
     hrefs.value = cli_malloc(sizeof(*hrefs.value));
-    fail_unless(!!hrefs.value, "cli_malloc");
+    ck_assert_msg(!!hrefs.value, "cli_malloc");
     hrefs.value[0] = (unsigned char *)realurl;
     hrefs.contents = cli_malloc(sizeof(*hrefs.contents));
-    fail_unless(!!hrefs.contents, "cli_malloc");
+    ck_assert_msg(!!hrefs.contents, "cli_malloc");
     hrefs.tag = cli_malloc(sizeof(*hrefs.tag));
-    fail_unless(!!hrefs.tag, "cli_malloc");
+    ck_assert_msg(!!hrefs.tag, "cli_malloc");
     hrefs.tag[0]      = (unsigned char *)cli_strdup("href");
     hrefs.contents[0] = (unsigned char *)cli_strdup(rtest->displayurl);
 
@@ -389,34 +385,34 @@ static void do_phishing_test(const struct rtest *rtest)
     rc = phishingScan(&ctx, &hrefs);
 
     html_tag_arg_free(&hrefs);
-    fail_unless(rc == CL_CLEAN, "phishingScan");
+    ck_assert_msg(rc == CL_CLEAN, "phishingScan");
     switch (rtest->result) {
         case 0:
-            fail_unless_fmt(ctx.found_possibly_unwanted,
+            ck_assert_msg(ctx.found_possibly_unwanted,
                             "this should be phishing, realURL: %s, displayURL: %s",
                             rtest->realurl, rtest->displayurl);
             break;
         case 1:
-            fail_unless_fmt(!ctx.found_possibly_unwanted,
+            ck_assert_msg(!ctx.found_possibly_unwanted,
                             "this should be whitelisted, realURL: %s, displayURL: %s",
                             rtest->realurl, rtest->displayurl);
             break;
         case 2:
-            fail_unless_fmt(!ctx.found_possibly_unwanted,
+            ck_assert_msg(!ctx.found_possibly_unwanted,
                             "this should be clean, realURL: %s, displayURL: %s",
                             rtest->realurl, rtest->displayurl);
             break;
         case 3:
             if (!loaded_2)
-                fail_unless_fmt(!ctx.found_possibly_unwanted,
+                ck_assert_msg(!ctx.found_possibly_unwanted,
                                 "this should be clean, realURL: %s, displayURL: %s",
                                 rtest->realurl, rtest->displayurl);
             else {
-                fail_unless_fmt(ctx.found_possibly_unwanted,
+                ck_assert_msg(ctx.found_possibly_unwanted,
                                 "this should be blacklisted, realURL: %s, displayURL: %s",
                                 rtest->realurl, rtest->displayurl);
                 if (*ctx.virname)
-                    fail_unless_fmt(!strstr((const char *)*ctx.virname, "Blacklisted"),
+                    ck_assert_msg(!strstr((const char *)*ctx.virname, "Blacklisted"),
                                     "should be blacklisted, but is: %s\n", ctx.virname);
             }
             break;
@@ -437,16 +433,16 @@ static void do_phishing_test_allscan(const struct rtest *rtest)
     ctx.options = &options;
 
     realurl = cli_strdup(rtest->realurl);
-    fail_unless(!!realurl, "cli_strdup");
+    ck_assert_msg(!!realurl, "cli_strdup");
 
     hrefs.count = 1;
     hrefs.value = cli_malloc(sizeof(*hrefs.value));
-    fail_unless(!!hrefs.value, "cli_malloc");
+    ck_assert_msg(!!hrefs.value, "cli_malloc");
     hrefs.value[0] = (unsigned char *)realurl;
     hrefs.contents = cli_malloc(sizeof(*hrefs.contents));
-    fail_unless(!!hrefs.contents, "cli_malloc");
+    ck_assert_msg(!!hrefs.contents, "cli_malloc");
     hrefs.tag = cli_malloc(sizeof(*hrefs.tag));
-    fail_unless(!!hrefs.tag, "cli_malloc");
+    ck_assert_msg(!!hrefs.tag, "cli_malloc");
     hrefs.tag[0]      = (unsigned char *)cli_strdup("href");
     hrefs.contents[0] = (unsigned char *)cli_strdup(rtest->displayurl);
 
@@ -457,41 +453,40 @@ static void do_phishing_test_allscan(const struct rtest *rtest)
     rc = phishingScan(&ctx, &hrefs);
 
     html_tag_arg_free(&hrefs);
-    fail_unless(rc == CL_CLEAN, "phishingScan");
+    ck_assert_msg(rc == CL_CLEAN, "phishingScan");
     switch (rtest->result) {
         case 0:
-            fail_unless_fmt(ctx.num_viruses,
+            ck_assert_msg(ctx.num_viruses,
                             "this should be phishing, realURL: %s, displayURL: %s",
                             rtest->realurl, rtest->displayurl);
             break;
         case 1:
-            fail_unless_fmt(!ctx.num_viruses,
+            ck_assert_msg(!ctx.num_viruses,
                             "this should be whitelisted, realURL: %s, displayURL: %s",
                             rtest->realurl, rtest->displayurl);
             break;
         case 2:
-            fail_unless_fmt(!ctx.num_viruses,
+            ck_assert_msg(!ctx.num_viruses,
                             "this should be clean, realURL: %s, displayURL: %s",
                             rtest->realurl, rtest->displayurl);
             break;
         case 3:
             if (!loaded_2)
-                fail_unless_fmt(!ctx.num_viruses,
+                ck_assert_msg(!ctx.num_viruses,
                                 "this should be clean, realURL: %s, displayURL: %s",
                                 rtest->realurl, rtest->displayurl);
             else {
-                fail_unless_fmt(ctx.num_viruses,
+                ck_assert_msg(ctx.num_viruses,
                                 "this should be blacklisted, realURL: %s, displayURL: %s",
                                 rtest->realurl, rtest->displayurl);
                 if (*ctx.virname)
-                    fail_unless_fmt(!strstr((const char *)*ctx.virname, "Blacklisted"),
+                    ck_assert_msg(!strstr((const char *)*ctx.virname, "Blacklisted"),
                                     "should be blacklisted, but is: %s\n", ctx.virname);
             }
             break;
     }
 }
 
-#ifdef CHECK_HAVE_LOOPS
 START_TEST(phishingScan_test)
 {
     do_phishing_test(&rtests[_i]);
@@ -503,9 +498,7 @@ START_TEST(phishingScan_test_allscan)
     do_phishing_test_allscan(&rtests[_i]);
 }
 END_TEST
-#endif
 
-#ifdef CHECK_HAVE_LOOPS
 static struct uc {
     const char *in;
     const char *host;
@@ -534,9 +527,9 @@ START_TEST(test_url_canon)
     struct uc *u = &uc[_i];
 
     cli_url_canon(u->in, strlen(u->in), urlbuff, sizeof(urlbuff), &host, &host_len, &path, &path_len);
-    fail_unless(!!host && !!path, "null results\n");
-    fail_unless_fmt(!strcmp(u->host, host), "host incorrect: %s\n", host);
-    fail_unless_fmt(!strcmp(u->path, path), "path incorrect: %s\n", path);
+    ck_assert_msg(!!host && !!path, "null results\n");
+    ck_assert_msg(!strcmp(u->host, host), "host incorrect: %s\n", host);
+    ck_assert_msg(!strcmp(u->path, path), "path incorrect: %s\n", path);
 }
 END_TEST
 
@@ -556,23 +549,22 @@ START_TEST(test_regexes)
     struct regex_test *tst = &rg[_i];
     int match;
 
-    fail_unless(cli_regcomp(&reg, tst->regex, REG_EXTENDED | REG_NOSUB) == 0, "cli_regcomp");
+    ck_assert_msg(cli_regcomp(&reg, tst->regex, REG_EXTENDED | REG_NOSUB) == 0, "cli_regcomp");
     match = (cli_regexec(&reg, tst->text, 0, NULL, 0) == REG_NOMATCH) ? 0 : 1;
-    fail_unless_fmt(match == tst->match, "cli_regexec failed for %s and %s\n", tst->regex, tst->text);
+    ck_assert_msg(match == tst->match, "cli_regexec failed for %s and %s\n", tst->regex, tst->text);
     cli_regfree(&reg);
 }
 END_TEST
-#endif
 
 START_TEST(phishing_fake_test)
 {
     char buf[4096];
     FILE *f = fdopen(open_testfile("input/daily.pdb"), "r");
-    fail_unless(!!f, "fopen daily.pdb");
+    ck_assert_msg(!!f, "fopen daily.pdb");
     while (fgets(buf, sizeof(buf), f)) {
         struct rtest rtest;
         const char *pdb = strchr(buf, ':');
-        fail_unless(!!pdb, "missing : in pdb");
+        ck_assert_msg(!!pdb, "missing : in pdb");
         rtest.realurl    = pdb;
         rtest.displayurl = pdb;
         rtest.result     = 2;
@@ -589,11 +581,11 @@ START_TEST(phishing_fake_test_allscan)
 {
     char buf[4096];
     FILE *f = fdopen(open_testfile("input/daily.pdb"), "r");
-    fail_unless(!!f, "fopen daily.pdb");
+    ck_assert_msg(!!f, "fopen daily.pdb");
     while (fgets(buf, sizeof(buf), f)) {
         struct rtest rtest;
         const char *pdb = strchr(buf, ':');
-        fail_unless(!!pdb, "missing : in pdb");
+        ck_assert_msg(!!pdb, "missing : in pdb");
         rtest.realurl    = pdb;
         rtest.displayurl = pdb;
         rtest.result     = 2;
@@ -616,42 +608,42 @@ Suite *test_regex_suite(void)
     tcase_add_checked_fixture(tc_api, setup, teardown);
     tcase_add_test(tc_api, empty);
     tcase_add_test(tc_api, one);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_api, test_suffix, 0, sizeof(tests) / sizeof(tests[0]));
-#endif
+
     tc_matching = tcase_create("regex_list");
     suite_add_tcase(s, tc_matching);
     tcase_add_checked_fixture(tc_matching, rsetup, rteardown);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_matching, regex_list_match_test, 0, sizeof(rtests) / sizeof(rtests[0]));
-#endif
+
     tc_phish = tcase_create("phishingScan");
     suite_add_tcase(s, tc_phish);
     tcase_add_unchecked_fixture(tc_phish, psetup, pteardown);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_phish, phishingScan_test, 0, sizeof(rtests) / sizeof(rtests[0]));
     tcase_add_loop_test(tc_phish, phishingScan_test_allscan, 0, sizeof(rtests) / sizeof(rtests[0]));
-#endif
+
     tcase_add_test(tc_phish, phishing_fake_test);
     tcase_add_test(tc_phish, phishing_fake_test_allscan);
 
     tc_phish2 = tcase_create("phishingScan with 2 dbs");
     suite_add_tcase(s, tc_phish2);
     tcase_add_unchecked_fixture(tc_phish2, psetup2, pteardown);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_phish2, phishingScan_test, 0, sizeof(rtests) / sizeof(rtests[0]));
     tcase_add_loop_test(tc_phish2, phishingScan_test_allscan, 0, sizeof(rtests) / sizeof(rtests[0]));
-#endif
+
     tcase_add_test(tc_phish2, phishing_fake_test);
     tcase_add_test(tc_phish2, phishing_fake_test_allscan);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_phish, test_url_canon, 0, sizeof(uc) / sizeof(uc[0]));
-#endif
+
 
     tc_regex = tcase_create("cli_regcomp/execute");
     suite_add_tcase(s, tc_regex);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_regex, test_regexes, 0, sizeof(rg) / sizeof(rg[0]));
-#endif
+
     return s;
 }
diff --git a/unit_tests/check_str.c b/unit_tests/check_str.c
index a5218ae..ff84d37 100644
--- a/unit_tests/check_str.c
+++ b/unit_tests/check_str.c
@@ -1,7 +1,7 @@
 /*
  *  Unit tests for string functions.
  *
- *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2008-2013 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -42,15 +42,15 @@
 START_TEST(test_unescape_simple)
 {
     char *str = cli_unescape("");
-    fail_unless(str && strlen(str) == 0, "cli_unescape empty string");
+    ck_assert_msg(str && strlen(str) == 0, "cli_unescape empty string");
     free(str);
 
     str = cli_unescape("1");
-    fail_unless(str && !strcmp(str, "1"), "cli_unescape one char");
+    ck_assert_msg(str && !strcmp(str, "1"), "cli_unescape one char");
     free(str);
 
     str = cli_unescape("tesT");
-    fail_unless(str && !strcmp(str, "tesT"), "cli_unescape simple string");
+    ck_assert_msg(str && !strcmp(str, "tesT"), "cli_unescape simple string");
     free(str);
 }
 END_TEST
@@ -58,19 +58,19 @@ END_TEST
 START_TEST(test_unescape_hex)
 {
     char *str = cli_unescape("%5a");
-    fail_unless(str && !strcmp(str, "\x5a"), "cli_unescape hex");
+    ck_assert_msg(str && !strcmp(str, "\x5a"), "cli_unescape hex");
     free(str);
 
     str = cli_unescape("%b5%8");
-    fail_unless(str && !strcmp(str, "\xb5%8"), "cli_unescape truncated");
+    ck_assert_msg(str && !strcmp(str, "\xb5%8"), "cli_unescape truncated");
     free(str);
 
     str = cli_unescape("%b5%");
-    fail_unless(str && !strcmp(str, "\xb5%"), "cli_unescape truncated/2");
+    ck_assert_msg(str && !strcmp(str, "\xb5%"), "cli_unescape truncated/2");
     free(str);
 
     str = cli_unescape("%00");
-    fail_unless(str && !strcmp(str, "\x1"), "cli_unescape %00");
+    ck_assert_msg(str && !strcmp(str, "\x1"), "cli_unescape %00");
     free(str);
 }
 END_TEST
@@ -79,16 +79,16 @@ START_TEST(test_unescape_unicode)
 {
     char *str = cli_unescape("%u05D0");
     /* unicode is converted to utf-8 representation */
-    fail_unless(str && !strcmp(str, "\xd7\x90"), "cli_unescape unicode aleph");
+    ck_assert_msg(str && !strcmp(str, "\xd7\x90"), "cli_unescape unicode aleph");
     free(str);
 
     str = cli_unescape("%u00a2%u007f%u0080%u07ff%u0800%ue000");
-    fail_unless(str && !strcmp(str, "\xc2\xa2\x7f\xc2\x80\xdf\xbf\xe0\xa0\x80\xee\x80\x80"),
+    ck_assert_msg(str && !strcmp(str, "\xc2\xa2\x7f\xc2\x80\xdf\xbf\xe0\xa0\x80\xee\x80\x80"),
                 "cli_unescape utf-8 test");
     free(str);
 
     str = cli_unescape("%%u123%u12%u1%u%u1234");
-    fail_unless(str && !strcmp(str, "%%u123%u12%u1%u\xe1\x88\xb4"),
+    ck_assert_msg(str && !strcmp(str, "%%u123%u12%u1%u\xe1\x88\xb4"),
                 "cli_unescape unicode truncated");
 
     free(str);
@@ -111,26 +111,26 @@ static void buf_teardown(void)
 
 START_TEST(test_append_len)
 {
-    fail_unless(textbuffer_append_len(&buf, "test", 3) != -1, "tbuf append");
-    fail_unless(buf.data && !strncmp(buf.data, "tes", 3), "textbuffer_append_len");
+    ck_assert_msg(textbuffer_append_len(&buf, "test", 3) != -1, "tbuf append");
+    ck_assert_msg(buf.data && !strncmp(buf.data, "tes", 3), "textbuffer_append_len");
     errmsg_expected();
-    fail_unless(textbuffer_append_len(&buf, "test", CLI_MAX_ALLOCATION) == -1, "tbuf append");
-    fail_unless(buf.data && !strncmp(buf.data, "tes", 3), "textbuffer_append_len");
+    ck_assert_msg(textbuffer_append_len(&buf, "test", CLI_MAX_ALLOCATION) == -1, "tbuf append");
+    ck_assert_msg(buf.data && !strncmp(buf.data, "tes", 3), "textbuffer_append_len");
 }
 END_TEST
 
 START_TEST(test_append)
 {
-    fail_unless(textbuffer_append(&buf, "test") != -1, "tbuf append");
-    fail_unless(textbuffer_putc(&buf, '\0') != -1, "tbuf putc");
-    fail_unless(buf.data && !strcmp(buf.data, "test"), "textbuffer_append");
+    ck_assert_msg(textbuffer_append(&buf, "test") != -1, "tbuf append");
+    ck_assert_msg(textbuffer_putc(&buf, '\0') != -1, "tbuf putc");
+    ck_assert_msg(buf.data && !strcmp(buf.data, "test"), "textbuffer_append");
 }
 END_TEST
 
 START_TEST(test_putc)
 {
-    fail_unless(textbuffer_putc(&buf, '\x5a') != -1, "tbuf putc");
-    fail_unless(buf.data && buf.data[0] == '\x5a', "textbuffer_putc");
+    ck_assert_msg(textbuffer_putc(&buf, '\x5a') != -1, "tbuf putc");
+    ck_assert_msg(buf.data && buf.data[0] == '\x5a', "textbuffer_putc");
 }
 END_TEST
 
@@ -141,10 +141,10 @@ START_TEST(test_normalize)
     int rc;
 
     rc = cli_textbuffer_append_normalize(&buf, str, strlen(str));
-    fail_unless(rc != -1, "normalize");
+    ck_assert_msg(rc != -1, "normalize");
 
-    fail_unless(textbuffer_putc(&buf, '\0') != -1, "putc \\0");
-    fail_unless(buf.data && !strcmp(buf.data, expected), "normalized text");
+    ck_assert_msg(textbuffer_putc(&buf, '\0') != -1, "putc \\0");
+    ck_assert_msg(buf.data && !strcmp(buf.data, expected), "normalized text");
 }
 END_TEST
 
@@ -156,17 +156,16 @@ START_TEST(hex2str)
     const char inp2[] = "ag0026";
 
     r = cli_hex2str(inp1);
-    fail_unless(!!r, "cli_hex2str NULL");
-    fail_unless(!memcmp(r, out1, sizeof(out1) - 1),
+    ck_assert_msg(!!r, "cli_hex2str NULL");
+    ck_assert_msg(!memcmp(r, out1, sizeof(out1) - 1),
                 "cli_hex2str invalid output");
     free(r);
 
     r = cli_hex2str(inp2);
-    fail_unless(!r, "cli_hex2str on invalid input");
+    ck_assert_msg(!r, "cli_hex2str on invalid input");
 }
 END_TEST
 
-#ifdef CHECK_HAVE_LOOPS
 static struct base64lines {
     const char *line;
     const char *decoded;
@@ -190,10 +189,10 @@ START_TEST(test_base64)
     unsigned char buf[1024];
     const struct base64lines *test = &base64tests[_i];
     message *m                     = messageCreate();
-    fail_unless(!!m, "Unable to create message");
+    ck_assert_msg(!!m, "Unable to create message");
 
     ret = decodeLine(m, BASE64, test->line, buf, sizeof(buf));
-    fail_unless(!!ret, "unable to decode line");
+    ck_assert_msg(!!ret, "unable to decode line");
 
     ret2 = base64Flush(m, ret);
 
@@ -201,9 +200,9 @@ START_TEST(test_base64)
         ret2 = ret;
     *ret2 = '\0';
     len   = ret2 - buf;
-    fail_unless_fmt(len == test->len, "invalid base64 decoded length: %u expected %u (%s)\n",
+    ck_assert_msg(len == test->len, "invalid base64 decoded length: %u expected %u (%s)\n",
                     len, test->len, buf);
-    fail_unless_fmt(!memcmp(buf, test->decoded, test->len),
+    ck_assert_msg(!memcmp(buf, test->decoded, test->len),
                     "invalid base64 decoded data: %s, expected:%s\n",
                     buf, test->decoded);
     messageDestroy(m);
@@ -245,13 +244,12 @@ static unsigned u16_len(const char *s)
 START_TEST(test_u16_u8)
 {
     char *result = cli_utf16_to_utf8(u16_tests[_i].u16, u16_len(u16_tests[_i].u16), UTF16_LE);
-    fail_unless(!!result, "cli_utf16_to_utf8 non-null");
-    fail_unless_fmt(!strcmp(result, u16_tests[_i].u8), "utf16_to_8 %d failed, expected: %s, got %s", _i, u16_tests[_i].u8, result);
+    ck_assert_msg(!!result, "cli_utf16_to_utf8 non-null");
+    ck_assert_msg(!strcmp(result, u16_tests[_i].u8), "utf16_to_8 %d failed, expected: %s, got %s", _i, u16_tests[_i].u8, result);
     free(result);
 }
 END_TEST
 
-#endif
 
 Suite *test_str_suite(void)
 {
@@ -275,14 +273,13 @@ Suite *test_str_suite(void)
     tc_str = tcase_create("str functions");
     suite_add_tcase(s, tc_str);
     tcase_add_test(tc_str, hex2str);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_str, test_u16_u8, 0, sizeof(u16_tests) / sizeof(u16_tests[0]));
-#endif
 
     tc_decodeline = tcase_create("decodeline");
     suite_add_tcase(s, tc_decodeline);
-#ifdef CHECK_HAVE_LOOPS
+
     tcase_add_loop_test(tc_decodeline, test_base64, 0, sizeof(base64tests) / sizeof(base64tests[0]));
-#endif
+
     return s;
 }
diff --git a/unit_tests/check_uniq.c b/unit_tests/check_uniq.c
index 487f474..2cd0667 100644
--- a/unit_tests/check_uniq.c
+++ b/unit_tests/check_uniq.c
@@ -36,7 +36,7 @@ START_TEST(test_uniq_initfail)
 {
     struct uniq *U;
     U = uniq_init(0);
-    fail_unless(U == NULL, "uniq_init(0)!=NULL");
+    ck_assert_msg(U == NULL, "uniq_init(0)!=NULL");
 }
 END_TEST
 
@@ -58,20 +58,20 @@ START_TEST(test_uniq_known)
     int i;
 
     struct uniq *U = uniq_init(5);
-    fail_unless(U != 0, "uniq_init");
+    ck_assert_msg(U != 0, "uniq_init");
 
     for (i = 0; tests[i].expected; i++) {
         if (CL_SUCCESS != uniq_add(U, tests[i].key, tests[i].key_len, &hash, &u)) {
-            fail("uniq_add(%s) failed.", tests[i].key);
+            ck_abort_msg("uniq_add(%s) failed.", tests[i].key);
         }
-        fail_unless_fmt(u == 1 && strcmp(hash, tests[i].expected) == 0, "uniq_add(%s) = %u - expected %s, got %s", tests[i].key, u, tests[i].expected, hash);
+        ck_assert_msg(u == 1 && strcmp(hash, tests[i].expected) == 0, "uniq_add(%s) = %u - expected %s, got %s", tests[i].key, u, tests[i].expected, hash);
     }
 
     for (i = 0; tests[i].expected; i++) {
         if (CL_SUCCESS != uniq_get(U, tests[i].key, tests[i].key_len, &hash, &u)) {
-            fail("uniq_get(%s) failed.", tests[i].key);
+            ck_abort_msg("uniq_get(%s) failed.", tests[i].key);
         }
-        fail_unless_fmt(u == 1 && strcmp(hash, tests[i].expected) == 0, "uniq_get(%s) = %u - expected %s, got %s", tests[i].key, u, tests[i].expected, hash);
+        ck_assert_msg(u == 1 && strcmp(hash, tests[i].expected) == 0, "uniq_get(%s) = %u - expected %s, got %s", tests[i].key, u, tests[i].expected, hash);
     }
 
     uniq_free(U);
@@ -85,20 +85,20 @@ START_TEST(test_uniq_colls)
     int i, j;
 
     struct uniq *U = uniq_init(10);
-    fail_unless(U != 0, "uniq_init");
+    ck_assert_msg(U != 0, "uniq_init");
 
     for (j = 4; j > 0; j--)
         for (i = 0; i < j; i++) {
             if (CL_SUCCESS != uniq_add(U, tests[i], strlen(tests[i]), NULL, &u)) {
-                fail("uniq_add(%s) failed.", tests[i]);
+                ck_abort_msg("uniq_add(%s) failed.", tests[i]);
             }
         }
 
     for (i = 0; i < 4; i++) {
         if (CL_SUCCESS != uniq_get(U, tests[i], strlen(tests[i]), NULL, &u)) {
-            fail("uniq_get(%s) failed.", tests[i]);
+            ck_abort_msg("uniq_get(%s) failed.", tests[i]);
         }
-        fail_unless_fmt(u + i == 4, "uniq_get(%s) = %u - expected %u", tests[i], u, 4 - i);
+        ck_assert_msg(u + i == 4, "uniq_get(%s) = %u - expected %u", tests[i], u, 4 - i);
     }
 
     uniq_free(U);
diff --git a/unit_tests/checks_common.h b/unit_tests/checks_common.h
index a1f3da8..fbe5832 100644
--- a/unit_tests/checks_common.h
+++ b/unit_tests/checks_common.h
@@ -1,16 +1,4 @@
 #ifndef CHECKS_COMMON_H
 #define CHECKS_COMMON_H
 
-#if CHECK_MAJOR_VERSION > 0 || (CHECK_MINOR_VERSION > 9 || (CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION > 3))
-#define CHECK_HAVE_LOOPS
-#endif
-
-#if CHECK_MAJOR_VERSION > 0 || (CHECK_MINOR_VERSION > 9 || (CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION > 0))
-#define fail_unless_fmt fail_unless
-#define fail_fmt fail
-#else
-#define fail_unless_fmt(cond, msg, ...) fail_unless(cond, msg)
-#define fail_fmt(msg, ...) fail(msg)
-#endif
-
 #endif

Reply to: