aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfsb4000 <fsb4000@yandex.ru>2015-03-12 20:13:49 +0600
committerfsb4000 <fsb4000@yandex.ru>2015-03-12 22:17:22 +0600
commite96c5184e783cf940956bf803dae8690dcf2b496 (patch)
treedd005a556e66cf569bd8dbbc0014d675f508e5c5 /src
parentdd4ffcec0ea561e16c4621b31712166717db3e0b (diff)
BUGFIX: Stack around the variable 'rv' was corrupted
Diffstat (limited to 'src')
-rw-r--r--src/uint256.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uint256.cpp b/src/uint256.cpp
index 3b1334a032..25148808c6 100644
--- a/src/uint256.cpp
+++ b/src/uint256.cpp
@@ -45,7 +45,7 @@ void base_blob<BITS>::SetHex(const char* psz)
psz++;
psz--;
unsigned char* p1 = (unsigned char*)data;
- unsigned char* pend = p1 + WIDTH * 4;
+ unsigned char* pend = p1 + WIDTH;
while (psz >= pbegin && p1 < pend) {
*p1 = ::HexDigit(*psz--);
if (psz >= pbegin) {
@@ -128,7 +128,7 @@ uint64_t uint256::GetHash(const uint256& salt) const
uint32_t a, b, c;
const uint32_t *pn = (const uint32_t*)data;
const uint32_t *salt_pn = (const uint32_t*)salt.data;
- a = b = c = 0xdeadbeef + (WIDTH << 2);
+ a = b = c = 0xdeadbeef + WIDTH;
a += pn[0] ^ salt_pn[0];
b += pn[1] ^ salt_pn[1];