Closed bhao-Soo closed 1 year ago
The pointer you pass to UninitSlice
when you create it must point into an actual allocation of the given length. If you give it a dangling address, then it is no surprise that it wont work.
I see you have opened multiple issues that look like this in quick succession. Please verify that they are actually issues before opening a bug report.
It is very sorry to bother you. I just want to know the reason of the error. Thank you very much for your timely reply, and now I understand.
version of bytes
1.2.1
Bug description
Heap-buffer-overflow found by Address-Sanitizer in fuzzy test because src/buf/uninit_slice.rs:76 unsafe write operation.
Steps to reproduce the behavior
Using auto-generated fuzz target can reproduce the behavior. it was uploaded to the issue platform. heap-buffer-overflow.zip
when complier the file with cargo, following the Instruction:
export RUSTFLAGS=-Zsanitizer=address RUSTDOCFLAGS=-Zsanitizer=address
cargo +nightly build
run the executive file with the crash input file to reproduce the behavior