mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-22 03:25:49 +00:00
Detect malformed data earlier during deserialization (RIPD-1695):
When deserializing specially crafted data, the code would ignore certain types of errors. Reserializing objects created from such data results in failures or generates a different serialization, which is not ideal. Also addresses: RIPD-1677, RIPD-1682, RIPD-1686 and RIPD-1689. Acknowledgements: Ripple thanks Guido Vranken for responsibly disclosing these issues. Bug Bounties and Responsible Disclosures: We welcome reviews of the rippled code and urge researchers to responsibly disclose any issues that they may find. For more on Ripple's Bug Bounty program, please visit: https://ripple.com/bug-bounty
This commit is contained in:
@@ -71,7 +71,9 @@ STTx::STTx (SerialIter& sit) noexcept (false)
|
||||
if ((length < txMinSizeBytes) || (length > txMaxSizeBytes))
|
||||
Throw<std::runtime_error> ("Transaction length invalid");
|
||||
|
||||
set (sit);
|
||||
if (set (sit))
|
||||
Throw<std::runtime_error> ("Transaction contains an object terminator");
|
||||
|
||||
tx_type_ = static_cast<TxType> (getFieldU16 (sfTransactionType));
|
||||
|
||||
applyTemplate (getTxFormat (tx_type_)->elements); // May throw
|
||||
|
||||
Reference in New Issue
Block a user