diff options
| author | Bitflash <btf01@proton.me> | 2026-07-28 15:25:15 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-28 15:25:15 -0300 |
| commit | 1635bc34f40c76ac2943dbe6ff15dd0180b62ea6 (patch) | |
| tree | c2a6057559ec93786ec5292b7a1836b972660d2b /src/db.cpp | |
| parent | e0c00d3e1b3192efde01fba85d0831470a8fb89c (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/db.cpp')
0 files changed, 0 insertions, 0 deletions