Page MenuHomePhabricator

Prevent ints from wrapping around in scratch space functions
ClosedPublic

Authored by deadalnix on Mon, Sep 28, 15:44.

Details

Summary
  • Add check preventing integer multiplication wrapping around in scratch_max_allocation
  • Add check preventing rounding to alignment from wrapping around in scratch_alloc
  • Use ROUND_TO_ALIGN in scratch_create
  • Don't assume that ALIGNMENT > 1 in tests

This is a backport of secp256k1 PR648

Test Plan
ninja check-secp256k1

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Mon, Sep 28, 16:36