Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 569)
+++ trunk/configure.ac	(revision 570)
@@ -12,5 +12,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 4.4.5)
+AM_INIT_AUTOMAKE(samhain, 4.4.6)
 AC_DEFINE([SAMHAIN], 1, [Application is samhain])
 AC_CANONICAL_HOST
Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 569)
+++ trunk/docs/Changelog	(revision 570)
@@ -1,5 +1,14 @@
+4.4.6:
+	* fix Debian 10 compile problem in dnmalloc (mallinfo2),
+	reported by A. Hofland and others
+	* fix compile problem on Ubuntu 20 with 'make deb'
+	(Debian optimization CFLAGS clash with ASM for Tiger)
+	* fix 'make deb' issue when compiling as client
+	(reported by A. Hofland)
+	* fix issue with inotify (reported by Thorsten)
+
 4.4.5:
 	* fix a memory leak introduced in 4.4.4
-	
+
 4.4.4:
 	* fix more gcc 10 compiler warnings
Index: trunk/src/bignum.c
===================================================================
--- trunk/src/bignum.c	(revision 569)
+++ trunk/src/bignum.c	(revision 570)
@@ -175,5 +175,5 @@
     for (base = 2; base <= 36; base++)
     {
-	tmp = ((1 << (DIGIT_BITS - 1)) / base);
+	tmp = ((1U << (DIGIT_BITS - 1)) / base);
 	maxdigit = tmp * 2;
 	curdigit = 1;
Index: trunk/src/sh_extern.c
===================================================================
--- trunk/src/sh_extern.c	(revision 569)
+++ trunk/src/sh_extern.c	(revision 570)
@@ -993,4 +993,5 @@
 	if (sh_string_len(s) == 0)
 	  {
+	    /* cppcheck-suppress syntaxError */
 	    --try; retry_msleep(0, 100);
 	  }
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 569)
+++ trunk/src/sh_hash.c	(revision 570)
@@ -2031,5 +2031,5 @@
 				       sl_strlen(theFile->link_path),
 				       hashbuf, sizeof(hashbuf)), 
-			 MAX_PATH_STORE+1);
+			 sizeof(linkHash));
 	      linkComp = linkHash;
 	      maxcomp  = KEY_LEN;
Index: trunk/src/sh_static.c
===================================================================
--- trunk/src/sh_static.c	(revision 569)
+++ trunk/src/sh_static.c	(revision 570)
@@ -464,6 +464,7 @@
 {
 	FILE *grf;
-	gid_t *group_list;
-	int num_groups, rv;
+	gid_t *group_list = NULL;
+	size_t num_groups;
+	int rv;
 	char **m;
 	struct group group;
@@ -474,5 +475,5 @@
 
 	/* We alloc space for 8 gids at a time. */
-	if (((group_list = calloc(8,sizeof(gid_t *))) != NULL)
+	if (buff && ((group_list = calloc(8,sizeof(gid_t *))) != NULL)
 		&& ((grf = fopen(_PATH_GROUP, "r")) != NULL)
 		) {
@@ -489,12 +490,19 @@
 					if (!strcmp(*m, user)) {
 						if (!(num_groups & 7)) {
-							gid_t *tmp = (gid_t *)
-								realloc(group_list,
-										(num_groups+8) * sizeof(gid_t *));
-							if (!tmp) {
-								rv = -1;
-								goto DO_CLOSE;
-							}
-							group_list = tmp;
+						  gid_t *tmp = NULL;
+						  if (num_groups > (SIZE_MAX - 8)) {
+						    rv = -1;
+						    goto DO_CLOSE;
+						  }
+						  if ((num_groups+8) <= (SIZE_MAX / sizeof(gid_t *))) {
+						    tmp = (gid_t *)
+						      realloc(group_list,
+							      (num_groups+8) * sizeof(gid_t *));
+						  } 
+						  if (!tmp) {
+						    rv = -1;
+						    goto DO_CLOSE;
+						  }
+						  group_list = tmp;
 						}
 						group_list[num_groups++] = group.gr_gid;
@@ -512,6 +520,7 @@
 	/* group_list will be NULL if initial malloc failed, which may trigger
 	 * warnings from various malloc debuggers. */
-	free(group_list);
-	free(buff);
+	if (group_list) free(group_list);
+	if (buff) free(buff);
+	/* cppcheck-suppress resourceLeak */
 	return rv;
 }
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 569)
+++ trunk/src/sh_unix.c	(revision 570)
@@ -3904,4 +3904,5 @@
 	  if (errno == EBADF && try == 0) /* obsolete, but we keep this, just in case */
 	    {
+	      /* cppcheck-suppress syntaxError */
 	      ++try;
 	      goto try_again;
Index: trunk/src/sh_utils.c
===================================================================
--- trunk/src/sh_utils.c	(revision 569)
+++ trunk/src/sh_utils.c	(revision 570)
@@ -1246,7 +1246,8 @@
     }
 
-  if (NULL == (new = calloc(1,strlen(new_in) + 1)))
+  len = strlen(new_in) + 1;
+  if (NULL == (new = calloc(1, len)))
     goto bail_mem;
-  sl_strncpy(new, new_in, strlen(new_in) + 1);
+  memcpy(new, new_in, len);
 
   key = new;
