Do not construct out-of-bound pointers in SHA512/SHA1/RIPEMD160 code

This commit is contained in:
Pieter Wuille
2019-05-03 16:08:11 -07:00
parent 94daebf327
commit c01c065b9d
3 changed files with 3 additions and 3 deletions

View File

@@ -163,7 +163,7 @@ CSHA1& CSHA1::Write(const unsigned char* data, size_t len)
sha1::Transform(s, buf);
bufsize = 0;
}
while (end >= data + 64) {
while (end - data >= 64) {
// Process full chunks directly from the source.
sha1::Transform(s, data);
bytes += 64;