Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use vsprintf_s on Windows and vsnprintf elsewhere instead of vsprintf #1121

Merged
merged 2 commits into from
Apr 28, 2020

Conversation

cjchapman
Copy link
Contributor

fixes #1118

Copy link
Contributor

@blueshade7 blueshade7 left a comment

Choose a reason for hiding this comment

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

According to https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l , Windows specific function vsprintf_s is more secure than vsnprintf (e.g., check against NULL passed as %s argument), so let me suggest to leave vsprintf_s as the definition of macro VSPRINTF_S on Windows, instead redefine it to be vsnprintf on non-Windows platform.

@cjchapman cjchapman changed the title use vsnprintf instead of vsprintf or vsprintf_s use vsprintf_s on Windows and vsnprintf elsewhere instead of vsprintf Apr 27, 2020
Copy link
Contributor

@blueshade7 blueshade7 left a comment

Choose a reason for hiding this comment

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

thanks

@cjchapman cjchapman merged commit 2973e18 into develop Apr 28, 2020
@cjchapman cjchapman deleted the cjc-use-vsnprintf branch April 28, 2020 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tx]crash while processing file
2 participants