Skip to content

Commit

Permalink
Merge pull request #860 from appneta/Bug_824_PR_843_empty_CIDR_check_…
Browse files Browse the repository at this point in the history
…staging

Bug #824 and PR #843: check for empty CIDR
  • Loading branch information
fklassen authored Jun 1, 2024
2 parents 2c435b9 + ef3df29 commit 36501b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ jobs:
if: steps.linter.outputs.checks-failed > 0
# for testing...
# run: echo "Some files failed the linting checks!"
# for development...
run: exit 0 # exit the job with a success status
# for actual deployment...
run: exit 1
# run: exit 1 # exit the job with a failure status

1 change: 1 addition & 0 deletions docs/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
06/01/2024 Version 4.5.0-beta1
- add check for IPv6 extension header length (#827 #842)
- add check for empty CIDR (#824 #843)
- GitHub template for pull requests (#839)
- handle IPv6 fragment extension header (#832 #837)
- configure.ac: unify search dirs for pcap and add lib32 (#819)
Expand Down
4 changes: 4 additions & 0 deletions src/common/cidr.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ parse_cidr(tcpr_cidr_t **cidrdata, char *cidrin, char *delim)
char *network;
char *token = NULL;

if (cidrin == NULL) {
errx(-1, "%s", "Unable to parse empty CIDR");
}

mask_cidr6(&cidrin, delim);

/* first iteration of input using strtok */
Expand Down

0 comments on commit 36501b0

Please sign in to comment.