Fix UUID String Handling in BLEUuid Class#348
Open
Mankianer wants to merge 2 commits intoarduino-libraries:masterfrom
Open
Fix UUID String Handling in BLEUuid Class#348Mankianer wants to merge 2 commits intoarduino-libraries:masterfrom
Mankianer wants to merge 2 commits intoarduino-libraries:masterfrom
Conversation
This commit addresses an issue in the BLEUuid class where the UUID string was not being properly copied. Previously, the class stored a pointer to the original string, which could lead to issues if the original string was modified or went out of scope. The fix involves changing the _str member of the BLEUuid class to be a non-const char pointer, and using the strdup function to create a copy of the string in the BLEUuid constructor. The destructor of the BLEUuid class has also been updated to free the memory allocated for the string copy. This change ensures that the BLEUuid class has its own copy of the UUID string, preventing potential issues caused by changes to the original string. Signed-off-by: Mankianer <mankianer@gmail.com>
|
Memory usage change @ b0edfc0
Click for full report table
Click for full report CSV |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #348 +/- ##
==========================================
+ Coverage 15.26% 15.38% +0.11%
==========================================
Files 29 29
Lines 3681 3686 +5
==========================================
+ Hits 562 567 +5
Misses 3119 3119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This pull request addresses a critical issue in the BLEUuid class where the UUID string was not being properly managed. The class was storing a pointer to the original string passed to it, which could lead to unexpected behavior if the original string was modified or went out of scope.
Changes made:
These changes ensure that the BLEUuid class correctly manages its own copy of the UUID string, preventing potential issues caused by changes to the original string. This makes the BLEUuid class more robust and reliable in its handling of UUID strings.