From 9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1 Mon Sep 17 00:00:00 2001 From: William Speirs Date: Tue, 14 Oct 2014 17:15:08 -0400 Subject: Changed to explicit heap allocated memory --- libs/sha1/sha1.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3