Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suricata/bpf: fix -Wshorten-64-to-32 warning (backport7) #12096

Merged
Merged
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 @@ -503,7 +503,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 @@ -518,7 +518,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 = SCMalloc(bpf_len);
if (unlikely(bpf_filter == NULL)) {
Expand Down
Loading