Skip to content

Commit

Permalink
Bug #813: back out PR #855
Browse files Browse the repository at this point in the history
Double free was fixed in PRs #711 and #851. This fix applied after these PRs introduces memory leaks.
  • Loading branch information
fklassen committed Jun 4, 2024
1 parent 4ea1f43 commit 84dee5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
9 changes: 5 additions & 4 deletions docs/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- add check for empty CIDR (#824 #843)
- AF_XDF socket extension (#822 #823)
- configure.ac: unify search dirs for pcap and add lib32 (#819)
- double free in tcpedit_dlt_cleanup in tcprewrite (#813 #855)
- CVE-2023-4256 double free in tcprewrite DLT_JUNIPER_ETHER (#813 #851)
- dlt_jnpr_ether_cleanup: check config before cleanup (#812 #851)
- nanosecond timestamps (#796)
- low PPS values run at full speed after several days (#779)
Expand Down Expand Up @@ -53,15 +53,16 @@
- build failures Debian/kfreebsd (#706)
- bus error when building on armhf (#705)
- typo fixes (#704)
- heap buffer overflow in tcpreplay (#703)
- double free in Juniper DLT (#702)
- CVE-2022-27418 heap buffer overflow in tcpreplay (#703)
- CVE-2022-27416 double free in Juniper DLT (#702)

01/31/2022 Version 4.4.0
- remove obsolete FORCE_ALIGN support to fix macOS 11 compile (#695)
- add a security policy document (#689)
- CVE-2021-45386 CVE-2021-45387 two reachable assertions in add_tree_ipv4() and add_tree_ipv6() (#687 #678)
- ability to specify directory of pcap files (#682)
- incorrect PPS rate for long-running sessions (#679)
- option --skipbroadcast not working (#677)
- option --skipbroadcast not working (#677 #678)
- revert #630 to fix --multiplier issues (#674)
- gcc 9.3 compiler warnings (#670)
- installed netmap not automatically detected (#669)
Expand Down
4 changes: 1 addition & 3 deletions src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ dlt_jnpr_ether_register(tcpeditdlt_t *ctx)
plugin = tcpedit_dlt_newplugin();

plugin->provides += PLUGIN_MASK_PROTO + PLUGIN_MASK_SRCADDR + PLUGIN_MASK_DSTADDR;
plugin->
requires
= 0;
plugin->requires = 0;

/* what is our DLT value? */
plugin->dlt = dlt_value;
Expand Down
12 changes: 0 additions & 12 deletions src/tcpedit/plugins/dlt_plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ const char *tcpeditdlt_bit_info[] = {"Missing required Layer 3 protocol.",
* Public functions
********************************************************************/

/*
* Ensure init/cleanup are called only once
* Assume a single tcpedit struct and return the previously allocated context.
*/
static int tcpedit_dlt_is_initialized = 0;

/**
* initialize our plugin library. Pass the DLT of the source pcap handle.
* Actions:
Expand All @@ -123,9 +117,6 @@ tcpedit_dlt_init(tcpedit_t *tcpedit, const int srcdlt)
assert(tcpedit);
assert(srcdlt >= 0);

if (tcpedit_dlt_is_initialized++ > 0)
return tcpedit->dlt_ctx;

ctx = (tcpeditdlt_t *)safe_malloc(sizeof(tcpeditdlt_t));

/* do we need a side buffer for L3 data? */
Expand Down Expand Up @@ -454,9 +445,6 @@ tcpedit_dlt_cleanup(tcpeditdlt_t *ctx)
{
tcpeditdlt_plugin_t *plugin;

if (--tcpedit_dlt_is_initialized <= 0)
return;

assert(ctx);

plugin = ctx->plugins;
Expand Down

0 comments on commit 84dee5e

Please sign in to comment.