upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/nostr.cpp
diff options
context:
space:
mode:
authorBitflash <btf01@proton.me>2026-07-28 15:25:15 -0300
committerGitHub <noreply@github.com>2026-07-28 15:25:15 -0300
commit1635bc34f40c76ac2943dbe6ff15dd0180b62ea6 (patch)
treec2a6057559ec93786ec5292b7a1836b972660d2b /src/nostr.cpp
parente0c00d3e1b3192efde01fba85d0831470a8fb89c (diff)
serialize: grow strings as data arrives, not to the declared length (#18)
The vector unserializer grows in 5 MB steps so a bogus length cannot make it allocate more than has actually been received. The string one resized straight to whatever ReadCompactSize returned, and ReadCompactSize has no ceiling -- nine bytes on the wire can name four gigabytes. Not reachable from the network today: the only string on a serialized type is CWalletTx::mapValue, and RelayMessage casts to CTransaction before sending, so it never leaves disk. This is a guard against the next network message that carries a string -- Bitcoin's own version message carries strSubVer -- rather than a fix for a live hole.
Diffstat (limited to 'src/nostr.cpp')
0 files changed, 0 insertions, 0 deletions