HomePhabricator

Fix signed subtraction overflow in CBigNum::setint64().
5849bd472a3aUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix signed subtraction overflow in CBigNum::setint64().

As noticed by sipa (Pieter Wuille), this can happen when CBigNum::setint64() is
called with an integer value of INT64_MIN (-2^63).

When compiled with -ftrapv, the program would crash. Otherwise, it would
execute an undefined operation (although in practice, usually the correct one).

Details

Provenance
Ricardo M. Correia <rcorreia@wizy.org>Authored on May 14 2012, 19:17
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING62e0453ce0ee: Add test case for CBigNum::setint64().
Branches
Unknown
Tags
Unknown

Event Timeline

Ricardo M. Correia <rcorreia@wizy.org> committed rSTAGING5849bd472a3a: Fix signed subtraction overflow in CBigNum::setint64(). (authored by Ricardo M. Correia <rcorreia@wizy.org>).May 14 2012, 19:26