Open coderabbitai[bot] opened 2 weeks ago
There's a potential stack overflow in Huffman<u8>::deser
due to recursive deserialization identified in PR #7. Consider implementing a maximum recursion depth or refactoring to an iterative deserialization approach to enhance robustness. See this comment for more details.
Description
Methods like
Node<u8>::deser
incrates/sourisdb/src/utilities/huffman.rs
use unbounded recursion, which could lead to stack overflow when handling malicious inputs that create deeply nested structures.We should consider refactoring these methods to use iterative approaches or implement recursion depth checks to prevent potential stack overflows.
Related PR: https://github.com/BurntNail/Souris/pull/7
Comment: https://github.com/BurntNail/Souris/pull/7#discussion_r1832050851
Requested by: @BurntNail