Skip to content
Closed
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
5 changes: 3 additions & 2 deletions src/suricata.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static void SetBpfStringFromFile(char *filename)
char *bpf_filter = NULL;
char *bpf_comment_tmp = NULL;
char *bpf_comment_start = NULL;
uint32_t bpf_len = 0;
size_t bpf_len = 0;
SCStat st;
FILE *fp = NULL;
size_t nm = 0;
Expand All @@ -520,7 +520,8 @@ static void SetBpfStringFromFile(char *filename)
SCLogError("Failed to stat file %s", filename);
exit(EXIT_FAILURE);
}
bpf_len = st.st_size + 1;
// st.st_size is signed on Windows
bpf_len = ((size_t)(st.st_size)) + 1;

bpf_filter = SCCalloc(1, bpf_len);
if (unlikely(bpf_filter == NULL)) {
Expand Down