summaryrefslogtreecommitdiffstats
path: root/src/sh_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sh_hash.c')
-rw-r--r--src/sh_hash.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/sh_hash.c b/src/sh_hash.c
index 345475d..f1adec4 100644
--- a/src/sh_hash.c
+++ b/src/sh_hash.c
@@ -23,6 +23,9 @@
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
@@ -50,7 +53,7 @@
#include "sh_hash.h"
#include "sh_error.h"
#include "sh_tiger.h"
-#include "sh_gpg.h"
+#include "sh_sig.h"
#include "sh_unix.h"
#include "sh_files.h"
#include "sh_ignore.h"
@@ -1254,7 +1257,7 @@ char * sh_hash_db2pop (const char * key, struct store2db * save)
******************************************************************/
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;
size_t len;
@@ -1265,6 +1268,9 @@ sh_file_t * sh_hash_push_int (file_type * buf, char * fileHash)
SL_ENTER(_("sh_hash_push_int"));
+ if (!buf)
+ SL_RETURN(NULL, _("sh_hash_push_int"));
+
fp = SH_ALLOC(sizeof(sh_file_t));
p.mark = REC_MAGIC;
@@ -1806,6 +1812,9 @@ static int handle_notfound(int log_severity, int class,
sh_file_t * p;
int retval = 0;
+ if (!theFile)
+ return retval;
+
if (S_FALSE == sh_ignore_chk_new(theFile->fullpath))
{
char * tmp = sh_util_safe_name(theFile->fullpath);
@@ -1898,7 +1907,10 @@ int sh_hash_compdata (int class, file_type * theFile, char * fileHash,
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)
log_severity = ShDFLevel[class];
@@ -2018,7 +2030,7 @@ int sh_hash_compdata (int class, file_type * theFile, char * fileHash,
TIGER_DATA,
sl_strlen(theFile->link_path),
hashbuf, sizeof(hashbuf)),
- MAX_PATH_STORE+1);
+ sizeof(linkHash));
linkComp = linkHash;
maxcomp = KEY_LEN;
}
@@ -2584,7 +2596,8 @@ int sh_hash_compdata (int class, file_type * theFile, char * fileHash,
_("Fetching audit record"),
_("sh_hash"), theFile->fullpath );
- if (NULL != sh_audit_fetch (theFile->fullpath, theFile->mtime, theFile->ctime, result, sizeof(result)))
+ if (NULL != sh_audit_fetch (theFile->fullpath, theFile->mtime, theFile->ctime, theFile->atime,
+ result, sizeof(result)))
{
#ifdef SH_USE_XML
sl_strlcat(msg, _("obj=\""), SH_MSG_BUF);