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

Bug #824 and PR #843: check for empty CIDR #860

Merged
merged 3 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
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: 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 @@ -18,7 +18,7 @@
* along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
*/

#include "defines.h"

Check failure on line 21 in src/common/cidr.c

View workflow job for this annotation

GitHub Actions / cpp-linter

src/common/cidr.c:21:10 [clang-diagnostic-error]

'defines.h' file not found
#include "config.h"
#include "common.h"
#include <arpa/inet.h>
Expand Down Expand Up @@ -249,6 +249,10 @@
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
Loading