Fix memory leaks and improve heap safety in NFC plugins#89
Open
baalpeteor2 wants to merge 2 commits intoluu176:mainfrom
Open
Fix memory leaks and improve heap safety in NFC plugins#89baalpeteor2 wants to merge 2 commits intoluu176:mainfrom
baalpeteor2 wants to merge 2 commits intoluu176:mainfrom
Conversation
Fix memory leaks and improve heap safety in NFC plugins
Author
|
compiled well in momentum, RM, and if I remember OFW last time I checked, and the compiled fap ran in all 3. If there's a problem compiling (an error w/ FelicaData* or FelicaSystem) let me know and I can upload the difference (basically changing FelicaData to FelicaSystem depending on OFW fw). |
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.
What's new
Inspiration: contributing to codebases I like to help make them better.
Summary
This PR fixes multiple memory leaks and improves memory safety in the Metroflip codebase to prevent crashes and out-of-memory errors on Flipper Zero devices.
Changes Made
DESFire AID variant added (Orca)
Ventra/Ultralight File Loading Fix
Buffer Size Verification
get_navigo_service_provider()buffer from 8 to 12 bytesMemory Leak Fixes
read_calypso_data()- Fixed memory leak when data not foundget_country_string()- Changed from malloc to static buffernfc_scanner_alloc()calls - Removed from 8 pluginsMemory Safety Improvements
CalypsoCardData initialization - Initialize pointers to NULL for safe cleanup
Allocation failure handling - Added NULL checks for malloc returns
Cleanup on failure - Added proper cleanup path for card data on early exit
NULL checks in cleanup - Added check for ctx->card in calypso_on_exit
Not fixed: this app should adopt a license, like the standard MIT license or something.
Verification
Checklist (For Reviewer)