Skip to content

Commit 9bcde8b

Browse files
author
Patrik Fiedler
committed
c'tor early return if the string is empty
1 parent 935917a commit 9bcde8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Release/src/utilities/web_utilities.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ plaintext_string winrt_encryption::decrypt() const
9292
win32_encryption::win32_encryption(const std::wstring &data) :
9393
m_numCharacters(data.size())
9494
{
95+
if (m_numCharacters == 0)
96+
{
97+
return;
98+
}
99+
95100
const auto dataNumBytes = data.size() * sizeof(std::wstring::value_type);
96101
m_buffer.resize(dataNumBytes);
97102
memcpy_s(m_buffer.data(), m_buffer.size(), data.c_str(), dataNumBytes);

0 commit comments

Comments
 (0)