diff options
author | William Speirs <bill.speirs@gmail.com> | 2014-10-14 17:15:08 -0400 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-10-15 00:58:56 +0200 |
commit | 9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1 (patch) | |
tree | f4dfa4af26f9e1a4f9485ebaa4874828676106a3 /libs/sha1/sha1.cpp | |
parent | 6433203b39f830a5c0d80347f14ab341ef3921ce (diff) | |
download | yosys-9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1.tar.gz yosys-9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1.tar.bz2 yosys-9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1.zip |
Changed to explicit heap allocated memory
Diffstat (limited to 'libs/sha1/sha1.cpp')
-rw-r--r-- | libs/sha1/sha1.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |