Page MenuHomePhabricator

Determine wallet file type based on file magic
AbandonedPublic

Authored by PiRK on Nov 26 2021, 14:57.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

core#19077 [18/26]

Determine wallet file type based on file magic

https://github.com/bitcoin/bitcoin/pull/19077/commits/ac38a87225be0f1103ff9629d63980550d2f372b

core#20216

wallet: fix buffer over-read in SQLite file magic check

If there is no terminating zero within the 16 magic bytes, the buffer would be
over-read in the std::string constructor. Fixed by using the "from buffer"
variant of the constructor (that also takes a size) rather than the "from c-string"
variant.

https://github.com/bitcoin/bitcoin/pull/20216/commits/56a461f72796ca60de28e78f144741eb1a4f5213

This is a backport of core#19077 [18/26] and core#20126

At this point, the new code is not reachable by users.

Depends on D10565

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Nov 26 2021, 14:58
This revision is now accepted and ready to land.Nov 26 2021, 16:44
PiRK edited the summary of this revision. (Show Details)

squash with D10578