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 #888: check for map == NULL in cidr.c #889

Merged
merged 1 commit into from
Jul 12, 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
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 @@ -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 @@ -337,6 +337,8 @@
/* 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
Loading