Closed
Description
read_mp4
calls read_moov
which calls read_pssh
which calls read_buf
which calls allocate_read_buf
and passes its result to Read::read
.
mp4parse-rust/mp4parse/src/lib.rs
Lines 2320 to 2321 in 26e614b
But the trait Read
is not unsafe, and it is never guaranteed to limit itself to writing to its single argument buf
, and the result of allocate_read_buf
is a vector of uninitialised bytes (that function should be unsafe, btw).
There were discussions about introducing a new unsafe trait in libstd to signal that a Read
implementation doesn't read in the writer it's supposed to write to, I don't know what became of it but I just found out about rust-lang/rust#42788 which seems related.
Metadata
Metadata
Assignees
Labels
No labels