plugins: handle allocation failures in radius and winbind - #629
Open
grey3228 wants to merge 1 commit into
Open
Conversation
The RADIUS and winbind plugins dereference memory allocation results without first checking for failure. This can crash pppd when memory is exhausted. Check the allocations before use and call novm(), consistent with other allocation sites in pppd. Free partially allocated RADIUS objects before invoking the fatal OOM handler. Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Collaborator
|
Looks fine. The added free() calls seem a little pointless when the process is about to terminate, but I guess they make the analyzers happier. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Static analysis found unchecked
malloc()andstrdup()results in the RADIUS and winbind plugins. Allocation failures could therefore result in NULL pointer dereferences.This change:
avpairoptions;novm().Out-of-memory conditions remain fatal through the existing
novm()handler.Found by Linux Verification Center (linuxtesting.org) with SVACE.