From: William Speirs Date: Tue, 14 Oct 2014 21:15:08 +0000 (-0400) Subject: Changed to explicit heap allocated memory X-Git-Tag: yosys-0.4~52^2~5 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1;p=yosys.git Changed to explicit heap allocated memory --- diff --git a/libs/sha1/sha1.cpp b/libs/sha1/sha1.cpp index dc86b2ce2..825274b9b 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; }