mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
Fix OOM bug: UTXO entries with invalid script length
This commit is contained in:
@@ -86,8 +86,14 @@ public:
|
||||
return;
|
||||
}
|
||||
nSize -= nSpecialScripts;
|
||||
script.resize(nSize);
|
||||
s >> REF(CFlatData(script));
|
||||
if (nSize > MAX_SCRIPT_SIZE) {
|
||||
// Overly long script, replace with a short invalid one
|
||||
script << OP_RETURN;
|
||||
s.ignore(nSize);
|
||||
} else {
|
||||
script.resize(nSize);
|
||||
s >> REF(CFlatData(script));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user