Merged
Conversation
Contributor
|
@seanm Friendly reminder. Is the PR still in progress? |
Contributor
Author
|
@asmorkalov I've been waiting to hear from an OpenCV developer. I marked it as WIP just so no one would merge it as-is. Biggest thing to discuss is if the approach of either/both of the 2 WIP commits is acceptible... |
These were non-trivial, requiring some pointer arithmetic.
…er length This allows replacing the unsafe sprintf with snprintf Also increased buffer size at call sites to be a little bigger, in case int is 64 bit.
Some places used 32, some 40. Increased them all to a littel bigger (50). It seems the largest possible string is currently 24 bytes, but future changes may require more space. Changed convertTypeStr from using the unsafe sprintf to snprintf. Alas, since the buffer size is not given to convertTypeStr, hardcode 50, which matches all the buffers actually passed.
Contributor
Author
|
@asmorkalov this is ready to commit IMHO. Care to review? I dropped the WIP commit and will make another PR with it. |
asmorkalov
approved these changes
Apr 17, 2023
Contributor
|
@opencv-alalek Could you take a look too? |
Merged
Contributor
Author
And here is the other/followup PR: #23502 |
Merged
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
Jan 4, 2024
* Replaced most remaining sprintf with snprintf * Deprecated encodeFormat and introduced new method that takes the buffer length * Also increased buffer size at call sites to be a little bigger, in case int is 64 bit
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
May 29, 2024
* Replaced most remaining sprintf with snprintf * Deprecated encodeFormat and introduced new method that takes the buffer length * Also increased buffer size at call sites to be a little bigger, in case int is 64 bit
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.
No description provided.