Skip to content

Commit

Permalink
Merge pull request #843 from GabrielGanne/empty-cidr-parse-fix
Browse files Browse the repository at this point in the history
add check for empty cidr
  • Loading branch information
fklassen authored Jun 1, 2024
2 parents 2c435b9 + a0b6d84 commit 963842c
Showing 1 changed file with 4 additions and 0 deletions.
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 963842c

Please sign in to comment.