You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vec::set_len leads to the creation of uninitialized memory which can be dropped if an error occurs during decoding. Additionally the other functions like decode_component have to be very careful to overwrite every single byte in the buffer lest uninitialized memory leak to the outside.
Is there any reason why vec![0; n] can't be used here? I doubt there would be a significant performance impact, if at all.
The text was updated successfully, but these errors were encountered:
It's indeed not ok, maybe worse than you'd think since the type of ret is not a Vec<u8> but a generic Vec<impl Send>. @fintelia I believe the necessary changes were part of the original #887 but dropped for the 0.21 branch since they change the interface. Now would be a good time for a rebase of those since 0.22 is delayed either way.
image/src/hdr/decoder.rs
Line 346 in 984e092
Vec::set_len
leads to the creation of uninitialized memory which can be dropped if an error occurs during decoding. Additionally the other functions likedecode_component
have to be very careful to overwrite every single byte in the buffer lest uninitialized memory leak to the outside.Is there any reason why
vec![0; n]
can't be used here? I doubt there would be a significant performance impact, if at all.The text was updated successfully, but these errors were encountered: