diff options
| author | Wladimir J. van der Laan <[email protected]> | 2017-02-19 13:23:50 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2017-02-19 13:28:30 +0100 |
| commit | 1f9e904f455679d1a297204a2ce44465e32751e2 (patch) | |
| tree | 0d9da649e7f02856b544d1cf9e8efb5f97fb58e5 /src | |
| parent | Merge #9657: Improve rpc-tests.py (diff) | |
| parent | Avoid VLA in hash.h (diff) | |
| download | discoin-1f9e904f455679d1a297204a2ce44465e32751e2.tar.xz discoin-1f9e904f455679d1a297204a2ce44465e32751e2.zip | |
Merge #9791: Avoid VLA in hash.h
5c8fd50 Avoid VLA in hash.h (Pieter Wuille)
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hash.h b/src/hash.h index 3b86fcc03..eacb8f04f 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) { |