Changed to explicit heap allocated memory

This commit is contained in:
William Speirs 2014-10-14 17:15:08 -04:00 committed by Clifford Wolf
parent 6433203b39
commit 9ee3a4b94f
1 changed files with 4 additions and 1 deletions

View File

@ -256,9 +256,12 @@ void SHA1::buffer_to_block(const std::string &buffer, uint32 block[BLOCK_BYTES])
void SHA1::read(std::istream &is, std::string &s, int max)
{
char sbuf[max];
char* sbuf = new char[max];
is.read(sbuf, max);
s.assign(sbuf, is.gcount());
delete[] sbuf;
}