Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Dec 28, 2022

No description provided.

@asmorkalov
Copy link
Contributor

@seanm Friendly reminder. Is the PR still in progress?

@seanm
Copy link
Contributor Author

seanm commented Mar 21, 2023

@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...

seanm added 3 commits April 14, 2023 15:06
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.
@seanm seanm changed the title WIP: more sprintf removals more sprintf removals Apr 14, 2023
@seanm
Copy link
Contributor Author

seanm commented Apr 14, 2023

@asmorkalov this is ready to commit IMHO. Care to review?

I dropped the WIP commit and will make another PR with it.

@asmorkalov
Copy link
Contributor

@opencv-alalek Could you take a look too?

@asmorkalov asmorkalov added this to the 4.8.0 milestone Apr 17, 2023
@seanm seanm mentioned this pull request Apr 17, 2023
@seanm
Copy link
Contributor Author

seanm commented Apr 17, 2023

I dropped the WIP commit and will make another PR with it.

And here is the other/followup PR: #23502

Copy link
Contributor

@opencv-alalek opencv-alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@asmorkalov asmorkalov merged commit 47bea69 into opencv:4.x Apr 18, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants