Page MenuHomePhabricator

Ensure that CDataStream never reads from empty buffers.
ClosedPublic

Authored by deadalnix on Jul 20 2017, 18:14.

Details

Summary

On some systems, current implementation of CDataStream sometime can read from empty buffers.

Test Plan

Added test cases. Checked with @CCulianu that the test case indeed trigger the bug on some specific systems and made sure the patch fixes it.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
streamnull
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 549
Build 549: arc lint + arc unit

Event Timeline

Ok, tested with your new "with arrays" addition.. everything checks out. On my Travis-work-alike system your test case failed, but with the patch to streams.h, your test case passed. Looks great.

This revision is now accepted and ready to land.Jul 20 2017, 18:22
This revision was automatically updated to reflect the committed changes.