HomePhabricator

Don't overflow signed ints in CBigNum::setint64().
fe78c9ae8b4cUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Don't overflow signed ints in CBigNum::setint64().

CBigNum::setint64() does 'n <<= 8', where n is of type "long long".

This leads to shifting onto and past the sign bit, which is undefined
behavior in C++11 and can cause problems in the future.

Details

Provenance
Ricardo M. Correia <rcorreia@wizy.org>Authored on May 14 2012, 00:50
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING4843b55fd167: Make CNetAddr::GetHash() return an unsigned val.
Branches
Unknown
Tags
Unknown

Event Timeline

Ricardo M. Correia <rcorreia@wizy.org> committed rSTAGINGfe78c9ae8b4c: Don't overflow signed ints in CBigNum::setint64(). (authored by Ricardo M. Correia <rcorreia@wizy.org>).May 14 2012, 00:53