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

datetime::to_string causes crash when m_interval is zero #1315

Open
bandrews-spirent opened this issue Jan 21, 2020 · 2 comments
Open

datetime::to_string causes crash when m_interval is zero #1315

bandrews-spirent opened this issue Jan 21, 2020 · 2 comments

Comments

@bandrews-spirent
Copy link

Previously, if datetime was zero, to_string would return "1601-01-01T00:00:00Z"
After upgrading to 2.10.14, sprintf_s throws with "Buffer too small, 0".

@bandrews-spirent
Copy link
Author

I worked around it by adding

if (m_interval <= 0)
{
    return U("1601-01-01T00:00:00Z");
}

just before this line
const int64_t epochAdjusted = static_cast<int64_t>(m_interval) - NtTo1900OffsetInterval;

@surendernitj
Copy link

surendernitj commented Jan 12, 2021

We are also hitting this issue while using C++ Azure storage sdk and work around for us is expensive/breaking change

Azure/azure-storage-cpp#379

Any help would be appreciated.

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

No branches or pull requests

2 participants