cpprestsdk
cpprestsdk copied to clipboard
datetime::to_string causes crash when m_interval is zero
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".
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;
We are also hitting this issue while using C++ Azure storage sdk and work around for us is expensive/breaking change
https://github.com/Azure/azure-storage-cpp/issues/379
Any help would be appreciated.