Skip to content

Commit

Permalink
Addressed CID 438831
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa authored and micahsnyder committed Apr 14, 2024
1 parent c4c8102 commit a7bb0dc
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit a7bb0dc

Please sign in to comment.