XRPL-Labs / xrpld-hooks

ISC License
94 stars 28 forks source link

slot_set() halts rippled when passed with invalid object #11

Closed technotip closed 1 year ago

technotip commented 3 years ago

Issue Description

When invalid object is passed to slot_set() as argument, it halts the rippled server.

Steps to Reproduce

        uint8_t keylet[34];
        int64_t slot_no = slot_set(SBUF(keylet), 0);

keylet has 00000000000000000000000000000000000000000000000000000000000000000000.

Expected Result

It should return a 'error code' indicating the invalid parameter or INVALID_ARGUMENT(-7).

Actual Result

Halts rippled.

rippled: /root/rippled/src/ripple/app/ledger/Ledger.cpp:411: 
virtual std::shared_ptr<const ripple::STLedgerEntry> 
ripple::Ledger::read(const ripple::Keylet&) const: Assertion `false' failed.
Aborted (core dumped)
RichardAH commented 1 year ago

Fixed in https://github.com/XRPL-Labs/xrpld-hooks/commit/7f72ef014be8a4eff833791f4f2f84444fdb966d