Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion clamonacc/inotif/inotif.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ int onas_ddd_init(uint64_t nwatches, size_t ht_size)
int ret = 0;
char nwatch_str[MAX_WATCH_LEN + 1] = {0};
char *p = NULL;
int64_t tmp = 0;
nwatches = 0;

nwfd = open(nwatch_file, O_RDONLY);
Expand All @@ -152,7 +153,13 @@ int onas_ddd_init(uint64_t nwatches, size_t ht_size)
close(nwfd);
if (ret < 0) return CL_EREAD;

nwatches = strtol(nwatch_str, &p, 10);
tmp = strtol(nwatch_str, &p, 10);
if (tmp < 0 || tmp == LONG_MAX){
/*Seems like a sane value (also the value on my ubuntu system)*/
nwatches = 0x10000;
} else {
nwatches = tmp;
}

ret = onas_ddd_init_wdlt(nwatches);
if (ret) return ret;
Expand Down
2 changes: 1 addition & 1 deletion libclamav/scanners.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ static cl_error_t cli_scanrar_file(const char *filepath, int desc, cli_ctx *ctx)
/*
* Extract the file...
*/
if (NULL != metadata.filename) {
if (0 != metadata.filename[0]) {
(void)cli_basename(metadata.filename, strlen(metadata.filename), &filename_base);
}

Expand Down
Loading