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

Fix some memory errors triggered by allocation failures #1995

Merged
merged 1 commit into from
May 29, 2023

Conversation

IvanNardi
Copy link
Collaborator

Some low hanging fruits found using nallocfuzz.
See: https://github.com/catenacyber/nallocfuzz
See: google/oss-fuzz#9902

Most of these errors are quite trivial to fix; the only exception is the stuff in the uthash.
If the insertion fails (because of an allocation failure), we need to avoid some memory leaks. But the only way to check if the HASH_ADD_* failed, is to perform a new lookup: a bit costly, but we don't use that code in any critical data-path.

example/reader_util.c Outdated Show resolved Hide resolved
Some low hanging fruits found using nallocfuzz.
See: https://github.com/catenacyber/nallocfuzz
See: google/oss-fuzz#9902

Most of these errors are quite trivial to fix; the only exception is the
stuff in the uthash.
If the insertion fails (because of an allocation failure), we need to
avoid some memory leaks. But the only way to check if the `HASH_ADD_*`
failed, is to perform a new lookup: a bit costly, but we don't use that
code in any critical data-path.
@sonarcloud
Copy link

sonarcloud bot commented May 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@utoni utoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@IvanNardi IvanNardi merged commit efb261a into ntop:dev May 29, 2023
@IvanNardi IvanNardi deleted the nallocfuzz branch May 29, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants