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

radix: Don't leak memory when key can't be added #9281

Closed
wants to merge 5 commits into from

Conversation

jlucovsky
Copy link
Contributor

Continuation of #9280

Thanks to @glongo for the contributions included in the redmine ticket.

Link to redmine ticket: 5748

Describe changes:

  • Check for duplicate keys before adding to radix tree.
  • Free key memory when key is a duplicate

Updates:

  • Reword comment regarding exclusive parameter.
  • No longer set sc_errno in success cases.
  • Comment rewording.

Provide values to any of the below to override the defaults.

To use a pull request use a branch name like pr/N where N is the pull request number.

SV_REPO=
SV_BRANCH=pr/1190
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Ensure that memory for the reputation key is released on failed adds.

Contributed by Giuseppe Longo <[email protected]>

Issue: 5748
This commit converts usages of `int` to `bool` within the radix utility
code.
Issue: 5748

This commit adds SC_EEXIST to be used for cases where an
item/resource/artifact with the same attributes already exists.
This commit prevents duplicate IPV4/IPV6 netblocks from being added to the
radix tree.

Contributed by Giuseppe Longo <[email protected]>

Issue: 5748
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #9281 (9e80d74) into master (1b08c56) will decrease coverage by 0.04%.
The diff coverage is 55.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9281      +/-   ##
==========================================
- Coverage   82.43%   82.40%   -0.04%     
==========================================
  Files         968      968              
  Lines      273953   273993      +40     
==========================================
- Hits       225840   225786      -54     
- Misses      48113    48207      +94     
Flag Coverage Δ
fuzzcorpus 64.63% <20.89%> (-0.09%) ⬇️
suricata-verify 60.82% <50.74%> (-0.01%) ⬇️
unittests 62.93% <41.79%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 15377

@victorjulien
Copy link
Member

Merged in #9306, thanks!

@jlucovsky jlucovsky deleted the 5748/10 branch September 5, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants