Skip to content

Commit

Permalink
Bug #888: check for map == NULL in cidr.c
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen committed Jul 12, 2024
1 parent 8e9cad0 commit d62a685
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
06/29/2024 Version 4.5.0-beta4
07/12/2024 Version 4.5.0-beta4
- NULL Pointer Dereference in parse_endpoints (#888)
- tcpreplay --include / --exclude to control which packets are replayed (#884)
- add -W (--suppress-warnings) option to suppress warning messages (#878)
- AF_XDP compile issue due to merge issue (#876)
Expand Down
2 changes: 2 additions & 0 deletions src/common/cidr.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ parse_endpoints(tcpr_cidrmap_t **cidrmap1, tcpr_cidrmap_t **cidrmap2, const char
/* do again with the second IP */
memset(newmap, '\0', NEWMAP_LEN);
map = strtok_r(NULL, ":", &token);
if (map == NULL)

Check warning on line 340 in src/common/cidr.c

View workflow job for this annotation

GitHub Actions / cpp-linter

src/common/cidr.c:340:25 [readability-braces-around-statements]

statement should be inside braces
goto done;

strlcpy(newmap, "0.0.0.0/0:", NEWMAP_LEN);
strlcat(newmap, map, NEWMAP_LEN);
Expand Down

0 comments on commit d62a685

Please sign in to comment.