Changed to explicit heap allocated memory
authorWilliam Speirs <bill.speirs@gmail.com>
Tue, 14 Oct 2014 21:15:08 +0000 (17:15 -0400)
committerClifford Wolf <clifford@clifford.at>
Tue, 14 Oct 2014 22:58:56 +0000 (00:58 +0200)
libs/sha1/sha1.cpp

index dc86b2ce2cf8884152bac0d5fb43ab036a43319f..825274b9b705724cb315eb2ec3b9ecbd56f39c95 100644 (file)
@@ -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;
 }