Fix regression in GetVarStr introduced in commit '8a5ada2d7'#480
Open
peolsson wants to merge 1 commit intottlappalainen:masterfrom
Open
Fix regression in GetVarStr introduced in commit '8a5ada2d7'#480peolsson wants to merge 1 commit intottlappalainen:masterfrom
peolsson wants to merge 1 commit intottlappalainen:masterfrom
Conversation
Owner
|
You need to check length for possible UTF8: |
122a389 to
8023cc5
Compare
Author
|
Thanks for the update. I added handling for unicode strings now as well. |
Owner
|
Move N2kUCS2ToUTF8Len above N2kUCS2ToUTF8 as I pointed. They have nearley same functionality so better to keep them near each other. |
When calling GetVarStr with a NULL pointer, it was originally expected that the function returned the length of the string, even though the string itself could not be stored. This is also what is expected in N2kDeviceList.cpp, which makes the change in '8a5ada2d7' to break the expected behaviour. This change restores the original behaviour.
8023cc5 to
6e05186
Compare
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.
When calling GetVarStr with a NULL pointer, it was originally expected that the function returned the length of the string, even though the string itself could not be stored. This is also what is expected in N2kDeviceList.cpp, which makes the change in '8a5ada2d7' to break the expected behaviour.
This change restores the original behaviour.