Fix put_time() crash on invalid struct tm data#4883
Merged
StephanTLavavej merged 18 commits intomicrosoft:mainfrom Aug 25, 2024
Merged
Fix put_time() crash on invalid struct tm data#4883StephanTLavavej merged 18 commits intomicrosoft:mainfrom
StephanTLavavej merged 18 commits intomicrosoft:mainfrom
Conversation
StephanTLavavej
requested changes
Aug 8, 2024
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
44acdd6 to
37d7f3e
Compare
TheStormN
commented
Aug 9, 2024
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Member
StephanTLavavej
left a comment
There was a problem hiding this comment.
Thanks, this is looking really good! I'm about to fall asleep so I want to take another look at this, but here are the comments I noticed.
eae10b0 to
bab2450
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
TheStormN
commented
Aug 10, 2024
005e5b8 to
3317d68
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
StephanTLavavej
approved these changes
Aug 21, 2024
Contributor
Author
|
Man, if we could just push a bit the UCRT team to replicate at least the validation behavior of other C libraries regarding |
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for fixing this long-standing bug and making this code so much more robust! 🎉 😸 🚀 |
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.
Fixes #4882
Fixes #924
My next PR about fixing
std::put_timecrashes.If all goes well I will try to also fix the performance issues mentioned in #3575 and #1900 before VS 17.12 cut.
UPDATE: The result now outputs single ? for every invalid tm struct data based on specifier. For example if tm struct contains invalid year and the format string is "%Y-%m-%d-%H-%M", the output will be like
?-08-10-00-45.