File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## [ 0.6.2] - 2021-02-12
8
+ ### Fixed
9
+ - Fixed assertions in ` le::read_u32_into ` and ` le::read_u64_into ` which could
10
+ have allowed buffers not to be fully populated (#1096 )
11
+
7
12
## [ 0.6.1] - 2021-01-03
8
13
### Fixed
9
14
- Avoid panic when using ` RngCore::seed_from_u64 ` with a seed which is not a
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " rand_core"
3
- version = " 0.6.1 "
3
+ version = " 0.6.2 "
4
4
authors = [" The Rand Project Developers" , " The Rust Project Developers" ]
5
5
license = " MIT OR Apache-2.0"
6
6
readme = " README.md"
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use core::convert::TryInto;
16
16
/// Reads unsigned 32 bit integers from `src` into `dst`.
17
17
#[ inline]
18
18
pub fn read_u32_into ( src : & [ u8 ] , dst : & mut [ u32 ] ) {
19
- assert ! ( 4 * src. len( ) >= dst. len( ) ) ;
19
+ assert ! ( src. len( ) >= 4 * dst. len( ) ) ;
20
20
for ( out, chunk) in dst. iter_mut ( ) . zip ( src. chunks_exact ( 4 ) ) {
21
21
* out = u32:: from_le_bytes ( chunk. try_into ( ) . unwrap ( ) ) ;
22
22
}
@@ -25,7 +25,7 @@ pub fn read_u32_into(src: &[u8], dst: &mut [u32]) {
25
25
/// Reads unsigned 64 bit integers from `src` into `dst`.
26
26
#[ inline]
27
27
pub fn read_u64_into ( src : & [ u8 ] , dst : & mut [ u64 ] ) {
28
- assert ! ( 8 * src. len( ) >= dst. len( ) ) ;
28
+ assert ! ( src. len( ) >= 8 * dst. len( ) ) ;
29
29
for ( out, chunk) in dst. iter_mut ( ) . zip ( src. chunks_exact ( 8 ) ) {
30
30
* out = u64:: from_le_bytes ( chunk. try_into ( ) . unwrap ( ) ) ;
31
31
}
You can’t perform that action at this time.
0 commit comments