aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-02-17 15:28:28 -0800
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-28 12:48:19 +0100
commit1825a03f8144572eaf532b6b3b3acc1a09577d1f (patch)
tree292fbd5c361e44406110e0d044083fa6ef73137c
parent289204fbe0c188b3cd145dd7b2e271f97a956ba3 (diff)
Avoid VLA in hash.h
Github-Pull: #9791 Rebased-From: 5c8fd508112016c3821b71112270afe83e6949ac
-rw-r--r--src/hash.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hash.h b/src/hash.h
index 3b86fcc033..eacb8f04fe 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -25,9 +25,9 @@ public:
static const size_t OUTPUT_SIZE = CSHA256::OUTPUT_SIZE;
void Finalize(unsigned char hash[OUTPUT_SIZE]) {
- unsigned char buf[sha.OUTPUT_SIZE];
+ unsigned char buf[CSHA256::OUTPUT_SIZE];
sha.Finalize(buf);
- sha.Reset().Write(buf, sha.OUTPUT_SIZE).Finalize(hash);
+ sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);
}
CHash256& Write(const unsigned char *data, size_t len) {
@@ -49,9 +49,9 @@ public:
static const size_t OUTPUT_SIZE = CRIPEMD160::OUTPUT_SIZE;
void Finalize(unsigned char hash[OUTPUT_SIZE]) {
- unsigned char buf[sha.OUTPUT_SIZE];
+ unsigned char buf[CSHA256::OUTPUT_SIZE];
sha.Finalize(buf);
- CRIPEMD160().Write(buf, sha.OUTPUT_SIZE).Finalize(hash);
+ CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);
}
CHash160& Write(const unsigned char *data, size_t len) {