Skip to content

Commit

Permalink
Update AdditiveCipherTemplate<S>::ProcessData (GH weidai11#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader authored and EAddario committed Apr 10, 2021
1 parent 5e3d53c commit 8e32f78
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions strciphr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ void AdditiveCipherTemplate<S>::ProcessData(byte *outString, const byte *inStrin

if (inString == outString)
{
m_tempOutString.Assign(inString, length);
// No need to copy inString to outString.
// Just allocate the space.
m_tempOutString.New(length);
m_tempOutString.SetMark(0);
outString = m_tempOutString.BytePtr();
copyOut = true;
Expand Down Expand Up @@ -242,7 +244,9 @@ void CFB_CipherTemplate<BASE>::ProcessData(byte *outString, const byte *inString

if (inString == outString)
{
m_tempOutString.Assign(inString, length);
// No need to copy inString to outString.
// Just allocate the space.
m_tempOutString.New(length);
m_tempOutString.SetMark(0);
outString = m_tempOutString.BytePtr();
copyOut = true;
Expand Down

0 comments on commit 8e32f78

Please sign in to comment.