Index: trunk/src/dnmalloc.c
===================================================================
--- trunk/src/dnmalloc.c	(revision 514)
+++ trunk/src/dnmalloc.c	(revision 516)
@@ -5296,5 +5296,5 @@
 {
   mstate av = get_malloc_state();
-  struct mallinfo mi;
+  static struct mallinfo mi;
   unsigned int i;
   mbinptr b;
@@ -5312,4 +5312,8 @@
   check_malloc_state();
 
+  if (!av || av->top == 0) {
+    return mi;
+  }
+  
   /* Account for top */
   avail = chunksize(av->top);
@@ -5362,12 +5366,11 @@
 	  (CHUNK_SIZE_T)(HASHTABLESIZE / (1024*1024)));
   fprintf(stderr, "max system bytes = %10lu\n",
-          (CHUNK_SIZE_T)(mi.usmblks));
+	  (CHUNK_SIZE_T)(mi.usmblks));
   fprintf(stderr, "system bytes     = %10lu  (%10lu sbrked, %10lu mmaped)\n",
-          (CHUNK_SIZE_T)(mi.arena + mi.hblkhd),
-          (CHUNK_SIZE_T)(mi.arena),
-          (CHUNK_SIZE_T)(mi.hblkhd));
+	  (CHUNK_SIZE_T)(mi.arena + mi.hblkhd),
+	  (CHUNK_SIZE_T)(mi.arena),
+	  (CHUNK_SIZE_T)(mi.hblkhd));
   fprintf(stderr, "in use bytes     = %10lu\n",
-          (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd));
-
+	  (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd));
 }
 
Index: trunk/src/sh_audit.c
===================================================================
--- trunk/src/sh_audit.c	(revision 514)
+++ trunk/src/sh_audit.c	(revision 516)
@@ -415,5 +415,5 @@
 /* Check whether it is already covered by a higher directory
  */
-static int test_exchange (struct aud_list * this, char * file)
+static int test_exchange (struct aud_list * this, const char * file)
 {
   size_t len0 = sl_strlen(this->file);
@@ -421,4 +421,7 @@
   int    ret  = -1;
 
+  if (!file || !this || !this->file)
+    return 0;
+  
   if (len0 == len1)
     {
Index: trunk/src/sh_err_log.c
===================================================================
--- trunk/src/sh_err_log.c	(revision 514)
+++ trunk/src/sh_err_log.c	(revision 516)
@@ -1284,5 +1284,5 @@
 	      status = sl_forward(fd);
 	      if (!SL_ISERROR(status))
-		status = sl_write (fd, report,  strlen(report));
+		sl_write (fd, report,  strlen(report));
 	      (void) sl_sync(fd);
 
Index: trunk/src/sh_files.c
===================================================================
--- trunk/src/sh_files.c	(revision 514)
+++ trunk/src/sh_files.c	(revision 516)
@@ -622,5 +622,5 @@
   size_t       l_name;
   char *       candidate = NULL;
-  size_t       l_candidate = 0;
+  volatile size_t       l_candidate = 0;
   
   if (NULL == tree)
@@ -2046,6 +2046,6 @@
 #endif
 
-static void * sh_dummy_dirlist;
-static void * sh_dummy_tmpcat;
+void * sh_dummy_dirlist;
+void * sh_dummy_tmpcat;
 
 /* -- Check a single directory and its content. Does not
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 514)
+++ trunk/src/sh_hash.c	(revision 516)
@@ -1255,5 +1255,5 @@
 sh_file_t * sh_hash_push_int (file_type * buf, char * fileHash)
 {
-  sh_file_t    * fp;
+  sh_file_t    * fp = NULL;
   sh_filestore_t p;
 
@@ -1266,4 +1266,7 @@
   SL_ENTER(_("sh_hash_push_int"));
 
+  if (!buf)
+    SL_RETURN(NULL, _("sh_hash_push_int"));
+    
   fp = SH_ALLOC(sizeof(sh_file_t));
 
@@ -1807,4 +1810,7 @@
   int         retval = 0;
 
+  if (!theFile)
+    return retval;
+  
   if (S_FALSE == sh_ignore_chk_new(theFile->fullpath))
     {
@@ -1899,5 +1905,8 @@
   SL_ENTER(_("sh_hash_compdata"));
 
-  if (IsInit != 1) sh_hash_init();
+  if (!theFile)
+    SL_RETURN(0, _("sh_hash_compdata"));
+
+ if (IsInit != 1) sh_hash_init();
 
   if (severity_override < 0)
Index: trunk/src/sh_log_repeat.c
===================================================================
--- trunk/src/sh_log_repeat.c	(revision 514)
+++ trunk/src/sh_log_repeat.c	(revision 516)
@@ -59,4 +59,6 @@
 #define SH_CLEANUP 256
 
+void * sh_dummy_g_array     = NULL;
+
 static struct gestalt * add_entry (unsigned char * flags, UINT16 * sum, 
 				   time_t ltime)
@@ -64,4 +66,6 @@
   struct gestalt * array = NULL;
 
+  sh_dummy_g_array = (void*) &array;
+  
  start:
   if (urec < nrec)
@@ -165,4 +169,6 @@
       struct gestalt * array = arec;
 
+      sh_dummy_g_array = (void*) &array;
+      
       memcpy(flint, flags, SH_NFIELDS);
 
Index: trunk/src/sh_mem.c
===================================================================
--- trunk/src/sh_mem.c	(revision 514)
+++ trunk/src/sh_mem.c	(revision 516)
@@ -318,6 +318,6 @@
 }
 
-static void ** sh_mem_dummy_a;
-static memlist_t ** sh_mem_merr_3;
+void ** sh_mem_dummy_a;
+memlist_t ** sh_mem_merr_3;
 
 void sh_mem_free (void * aa, char * file, int line)
Index: trunk/src/sh_portcheck.c
===================================================================
--- trunk/src/sh_portcheck.c	(revision 514)
+++ trunk/src/sh_portcheck.c	(revision 516)
@@ -1808,6 +1808,6 @@
 static int iface_comp (const void *a, const void *b)
 {
-  const struct portchk_interfaces * aa = (struct portchk_interfaces *) a;
-  const struct portchk_interfaces * bb = (struct portchk_interfaces *) b;
+  const struct portchk_interfaces * aa = (const struct portchk_interfaces *) a;
+  const struct portchk_interfaces * bb = (const struct portchk_interfaces *) b;
   return (aa->type - bb->type);
 }
Index: trunk/src/sh_string.c
===================================================================
--- trunk/src/sh_string.c	(revision 514)
+++ trunk/src/sh_string.c	(revision 516)
@@ -644,5 +644,6 @@
               len = (size_t) tlen;
 
-              if (tlen > 0 && r->siz > (r->len + len))
+              if (tlen > 0 && r->siz > (r->len + len) &&
+		  &(s->str[ovector[last]]) )
                 {
                   memcpy(p, &(s->str[ovector[last]]), (size_t)len);
@@ -675,5 +676,6 @@
             {
               len = (size_t)tlen;
-	      if (r->siz >= (r->len + len)) {
+	      if (r->siz >= (r->len + len) &&
+		  &(s->str[ovector[2*i -1]]) ) {
 		memcpy(p, &(s->str[ovector[2*i -1]]), (size_t)len);
 		p += (len - 1); 
Index: trunk/src/sh_suidchk.c
===================================================================
--- trunk/src/sh_suidchk.c	(revision 514)
+++ trunk/src/sh_suidchk.c	(revision 516)
@@ -997,6 +997,6 @@
  * by longjmp' warning. And no, 'volatile' proved insufficient.
  */
-static void * sh_dummy_dirlist = NULL;
-static void * sh_dummy_itmp    = NULL;
+void * sh_dummy_idirlist = NULL;
+void * sh_dummy_itmp     = NULL;
 
 
@@ -1028,6 +1028,6 @@
    * Avoids the 'clobbered by longjmp' warning. 
    */
-  sh_dummy_dirlist = (void*) &dirlist;
-  sh_dummy_itmp    = (void*) &tmp;
+  sh_dummy_idirlist = (void*) &dirlist;
+  sh_dummy_itmp     = (void*) &tmp;
 
   if (iname == NULL)
@@ -1146,5 +1146,5 @@
 				    ShSuidchkFps) , 0);
       }
-	      
+
     status = (int) retry_lstat(FIL__, __LINE__, tmpcat, &buf);
 
@@ -1186,4 +1186,5 @@
 	     */
 	    fs = filesystem_type (tmpcat, tmpcat, &buf);
+
 	    if (fs != NULL 
 #ifndef SH_SUIDTESTDIR
@@ -1520,4 +1521,5 @@
   status = sh_suidchk_check_internal (SH_SUIDTESTDIR);
 #else
+  #error
   status = sh_suidchk_check_internal ("/");
 #endif
@@ -2211,4 +2213,5 @@
   current_dev = statp->st_dev;
   current_fstype = filesystem_type_uncached (path, relpath, statp);
+  
   return current_fstype;
 }
@@ -2232,5 +2235,5 @@
 #endif
 
-#ifdef FSTYPE_MNTENT		/* 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
+#ifdef FSTYPE_MNTENT		/* 4.3BSD, SunOS, HP-UX, Dynix, Irix,Linux  */
   char *table = MOUNTED;
   FILE *mfp;
@@ -2294,10 +2297,12 @@
 	      volatile int  elevel = SH_ERR_ERR;
 	      size_t tlen = strlen(mnt->mnt_dir);
-
+	      
 	      if (tlen >= 6 && 0 == strcmp(&((mnt->mnt_dir)[tlen-6]), _("/.gvfs")))
 		elevel = SH_ERR_NOTICE;
 	      else if (tlen >= 5 && 0 == strcmp(&((mnt->mnt_dir)[tlen-5]), _("/gvfs")))
 		elevel = SH_ERR_NOTICE;
-
+	      else if (0 == strcmp (mnt->mnt_type, _("tracefs")))
+		elevel = SH_ERR_NOTICE;
+	      
 	      sl_snprintf(errmsg, sizeof(errmsg), _("stat(%s) failed"),
 			  mnt->mnt_dir);
@@ -2307,5 +2312,5 @@
 			       _("filesystem_type_uncached") );
 	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      return NULL;
+	      continue;
 	    }
 	  dev = disk_stats.st_dev;
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 514)
+++ trunk/src/sh_unix.c	(revision 516)
@@ -3792,6 +3792,6 @@
 
 static void * sh_dummy_filename;
-static void * sh_dummy_tmp;
-static void * sh_dummy_tmp2;
+void * sh_dummy_tmp;
+void * sh_dummy_tmp2;
 
 int sh_unix_getinfo (int level, const char * filename, file_type * theFile, 
