mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +01:00
b296d6ee3c
# Description The implementation of this function had a few issues before: - It didn't check that the `cp` pointer is actually ahead of the `start` pointer, so `len` could potentially underflow and wrap around, which would be a violation of memory safety - It used `Vec::from_raw_parts` even though the buffer is borrowed, not owned. Although `std::mem::forget` is used later to ensure the destructor doesn't run, there is a risk that the destructor would run if a panic happened during `String::from_utf8_unchecked`, which would lead to a `free()` of a pointer we don't own |
||
---|---|---|
.. | ||
examples | ||
src | ||
.gitignore | ||
Cargo.toml | ||
LICENSE |