upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorBitflash <btf01@proton.me>2026-07-28 12:25:29 -0300
committerGitHub <noreply@github.com>2026-07-28 12:25:29 -0300
commit1d0314c0d220231afc56193ba66b70234fa24092 (patch)
tree622bfdb3f3f7d442b08d83fdf613d4ea717135d3 /src/db.cpp
parentebb793b0c513e5ee0298228b0185b4bada842513 (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/db.cpp')
0 files changed, 0 insertions, 0 deletions