-
Notifications
You must be signed in to change notification settings - Fork 1.6k
yaml: Add check of allocation for node object v2 #11847
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
yaml: Add check of allocation for node object v2 #11847
Conversation
Fix potential dereference of nullptr in case of unsuccessful allocation of memory for list node Bug: OISF#7270
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11847 +/- ##
==========================================
- Coverage 82.58% 82.56% -0.02%
==========================================
Files 914 912 -2
Lines 249500 249353 -147
==========================================
- Hits 206045 205887 -158
- Misses 43455 43466 +11
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
wrt the unit test checks mentioned by @catenacyber , I'm assuming they're the ones in Should these be addressed as part of this work? |
From what I see, unittests are too dirty as they are and we're ok w that as long as its on the fail path. Running unittests w ASAN enabled will give you a long list of issues. |
catenacyber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work.
CI : ok
Commits segmentation : ok
Commit messages : ok
Git ID set : ok
CLA : ❓ I do not have access
Doc update : not needed
Redmine ticket : ok
Rustfmt : no rust
Tests : ❓ would you know how to test for this ? What was the static analysis tool ? Was it the only failed allocation missing test ?
Dependencies added: none
Code : good
|
@catenacyber , unfortunately I'm couldn't tell you a name of static analyzer. Also I wasn't available to reproduce this execution path in runtime. Static analyzer triggered only on fact that return value of function wasn't checked on null, but there is cases when function return nullptr(only one, when we couldn't allocate of memory) |
|
Looks like github/codeql#16524 |
|
Yep, exactly |
For the record, running locally this CodeQL query, using CodeQL suricata database downloaded from GitHub, I do not find this bug (even if it looks like I should) (and it finds other stuff related to lua) |
|
Sorry, probably my answer wasn't clear enough, I mean that static analyzer, which I've used have same type checker |
|
Merged in #11858, thanks! |
Fix potential dereference of nullptr in case
of unsuccessful allocation of memory for
list node
Bug: #7270
Contribution style:
https://docs.suricata.io/en/latest/devguide/contributing/contribution-process.html
Our Contribution agreements:
https://suricata.io/about/contribution-agreement/ (note: this is only required once)
Changes (if applicable):
(including schema descriptions)
https://redmine.openinfosecfoundation.org/projects/suricata/issues
Link to ticket: https://redmine.openinfosecfoundation.org/issues/7270
Describe changes:
Follows #11822 with transforming commit message to proper state