HomePhabricator

Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid…

Description

Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...)

Summary:
Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...).

Backport of Bitcoin Core PR14242
https://github.com/bitcoin/bitcoin/pull/14242

Test Plan:

make check

Reviewers: Fabien, #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D4017

Details

Provenance
practicalswift <practicalswift@users.noreply.github.com>Authored on Sep 17 2018, 14:30
fpelliccioniCommitted on Sep 11 2019, 19:46
nakihitoPushed on Sep 11 2019, 20:40
Reviewer
Restricted Project
Differential Revision
D4017: Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...)
Parents
rSTAGING29fec420b3e2: Pull leveldb subtree
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/11229, tag: phabricator/base/11224