aboutsummaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorWilliam Speirs <bill.speirs@gmail.com>2014-10-14 17:15:08 -0400
committerClifford Wolf <clifford@clifford.at>2014-10-15 00:58:56 +0200
commit9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1 (patch)
treef4dfa4af26f9e1a4f9485ebaa4874828676106a3 /libs
parent6433203b39f830a5c0d80347f14ab341ef3921ce (diff)
downloadyosys-9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1.tar.gz
yosys-9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1.tar.bz2
yosys-9ee3a4b94fa78ad2ccf4178d7a49bc659df29cb1.zip
Changed to explicit heap allocated memory
Diffstat (limited to 'libs')
-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 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;
}