Repository navigation
Fix a few issues detected with static code analysis - #131
tsautereau-anssi wants to merge 3 commits into
Conversation
All other calls to memory_map_fixed() are checked, and this one may also theoretically fail.
It's the region pointer that can be NULL here, and p was checked at the beginning of the function. Also fix the test accordingly.
It's the region pointer that can be NULL here, and p was checked at the beginning of the function.
| } | ||
| } | ||
|
|
||
| memory_map_fixed(ra->regions, ra->total * sizeof(struct region_metadata)); |
There was a problem hiding this comment.
This call shouldn't be checked because failure doesn't impact whether the function succeeded. It doesn't really matter if it succeeds. The point of doing this is to free memory.
|
I've cherry-picked the other 2 commits. I reworded the commit messages to explain what was wrong in both cases. The The |
|
The |
Alright, maybe a comment would help clarify this for future source code reviews/analyses, but thanks for the explanation! |
Static code analysis of hardened_malloc flagged some small issues. This pull request proposes fixes for three of them, and I'll open an issue to discuss the remaining ones, if that's OK for you.