diff options
| author | Bitflash <btf01@proton.me> | 2026-07-28 12:25:29 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-28 12:25:29 -0300 |
| commit | 1d0314c0d220231afc56193ba66b70234fa24092 (patch) | |
| tree | 622bfdb3f3f7d442b08d83fdf613d4ea717135d3 /src/rpc.cpp | |
| parent | ebb793b0c513e5ee0298228b0185b4bada842513 (diff) | |
btfaddr: reject malformed descriptors instead of throwing (#8)
VerifyDescriptor() parses descriptors received from untrusted peers over
Nostr relays. Only json::parse() was guarded; the field extractions
(get<std::string>, get<uint64_t>) ran unguarded, so a descriptor with a
wrong-typed field (e.g. a numeric "pubkey") threw an uncaught
nlohmann::json::type_error -- a remotely triggerable crash vector.
Validate each field's type up front and wrap the whole parse in try/catch
so any malformed descriptor is rejected (return false), never thrown.
Diffstat (limited to 'src/rpc.cpp')
0 files changed, 0 insertions, 0 deletions