Skip to content

Commit 1f9e904

Browse files
committed
Merge #9791: Avoid VLA in hash.h
5c8fd50 Avoid VLA in hash.h (Pieter Wuille)
2 parents 7ff4a53 + 5c8fd50 commit 1f9e904

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hash.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class CHash256 {
2525
static const size_t OUTPUT_SIZE = CSHA256::OUTPUT_SIZE;
2626

2727
void Finalize(unsigned char hash[OUTPUT_SIZE]) {
28-
unsigned char buf[sha.OUTPUT_SIZE];
28+
unsigned char buf[CSHA256::OUTPUT_SIZE];
2929
sha.Finalize(buf);
30-
sha.Reset().Write(buf, sha.OUTPUT_SIZE).Finalize(hash);
30+
sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);
3131
}
3232

3333
CHash256& Write(const unsigned char *data, size_t len) {
@@ -49,9 +49,9 @@ class CHash160 {
4949
static const size_t OUTPUT_SIZE = CRIPEMD160::OUTPUT_SIZE;
5050

5151
void Finalize(unsigned char hash[OUTPUT_SIZE]) {
52-
unsigned char buf[sha.OUTPUT_SIZE];
52+
unsigned char buf[CSHA256::OUTPUT_SIZE];
5353
sha.Finalize(buf);
54-
CRIPEMD160().Write(buf, sha.OUTPUT_SIZE).Finalize(hash);
54+
CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);
5555
}
5656

5757
CHash160& Write(const unsigned char *data, size_t len) {

0 commit comments

Comments
 (0)