projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6433203
)
Changed to explicit heap allocated memory
author
William Speirs
<bill.speirs@gmail.com>
Tue, 14 Oct 2014 21:15:08 +0000
(17:15 -0400)
committer
Clifford Wolf
<clifford@clifford.at>
Tue, 14 Oct 2014 22:58:56 +0000
(
00:58
+0200)
libs/sha1/sha1.cpp
patch
|
blob
|
history
diff --git
a/libs/sha1/sha1.cpp
b/libs/sha1/sha1.cpp
index dc86b2ce2cf8884152bac0d5fb43ab036a43319f..825274b9b705724cb315eb2ec3b9ecbd56f39c95 100644
(file)
--- 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;
}