From d5c5fedea2c1fc3bd76d79860c20271a6066a9e4 Mon Sep 17 00:00:00 2001 From: TimothyBanks Date: Fri, 17 Jul 2026 09:51:06 -0400 Subject: [PATCH] feat: Wasm Module Versioning --- src/libxrpl/tx/wasm/WasmiVM.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libxrpl/tx/wasm/WasmiVM.cpp b/src/libxrpl/tx/wasm/WasmiVM.cpp index 8d54895fbd..e63b76c078 100644 --- a/src/libxrpl/tx/wasm/WasmiVM.cpp +++ b/src/libxrpl/tx/wasm/WasmiVM.cpp @@ -831,9 +831,12 @@ readLEB128(Bytes const& wasmCode, size_t& offset) if (shift >= 32) { // Drain the rest of the bytes for this leb. - while (offset < wasmCode.size() && (wasmCode[offset] & 0x80) != 0) + while (offset < wasmCode.size()) { - ++offset; + if ((wasmCode[offset++] & 0x80) == 0) + { + break; + } } break; } @@ -881,7 +884,8 @@ filterCustomSections(Bytes const& wasmCode, Filter&& filter) if (offset >= nextSection) { - break; + offset = nextSection; + continue; } size = nextSection - offset;