Page MenuHomePhabricator

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

Authored by PiRK on Nov 26 2021, 17:02.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

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.

This is a backport of core#20216

Test Plan

ninja all check-all