summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/sha1/sha1.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/sha1/sha1.cpp b/libs/sha1/sha1.cpp
index dc86b2ce..825274b9 100644
--- a/libs/sha1/sha1.cpp
+++ b/libs/sha1/sha1.cpp
@@ -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;
}