rippled icon indicating copy to clipboard operation
rippled copied to clipboard

buffer Underflow vulnarability assertion check fix for RFC1751.cpp

Open nathanogaga118 opened this issue 1 year ago • 2 comments

an assertion check fix has been updated with the code

https://github.com/nathanogaga118/rippled/blob/develop/src/libxrpl/crypto/RFC1751.cpp

Key Changes and fixes:

Assertions Added:

In btoe: assert(strData.size() >= 8 && "strData must be at least 8 bytes long");

In getEnglishFromKey: assert(strKey.size() >= 16 && "strKey must be at least 16 bytes long");

These assertions ensure that the preconditions for the btoe function are met, preventing potential buffer underflow issues.

nathanogaga118 avatar Sep 11 '24 22:09 nathanogaga118

Please kindly re-format this PR, as per to https://github.com/XRPLF/rippled/blob/develop/CONTRIBUTING.md#formatting Note, we are using old clang-format-10, but it's trivial to setup with the help of containerised ubuntu:20.04 (https://packages.ubuntu.com/focal/clang-format-10 )

Bronek avatar Sep 13 '24 13:09 Bronek

Also, this PR seems to be removing existing comments from the codebase in a rather arbitrary manner, please do not do that without a good reason.

Bronek avatar Sep 13 '24 13:09 Bronek

Closed due to author's inactivity

Bronek avatar May 16 '25 08:05 Bronek