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
I am not sure how to fix this. Here's a reproducer that works on top of 75a0517 in quick-protobuf/src/reader.rs.
#[test]fnread_foomessage_panic(){let bytes = &[0,93,138,1,1,170,1,0];letmut r = BytesReader::from_bytes(bytes);assert!(!r.is_eof());assert_eq!(r.next_tag(bytes).unwrap(), 0);
r.read_unknown(bytes,0).unwrap();assert!(!r.is_eof());assert_eq!(r.next_tag(bytes).unwrap(), 138);
r.read_message::<Example>(bytes).unwrap();structExample;impl<'a>MessageRead<'a>forExample{fnfrom_reader(r:&mutBytesReader,bytes:&'a [u8]) -> Result<Self>{assert!(!r.is_eof());assert_eq!(r.next_tag(bytes).unwrap(), 170);// there's nothing to read for the nested messageassert_eq!(r.len(), 0);// this will call BytesReader::len which will trigger the subtraction with overflow
r.read_packed_fixed::<&[f32]>(bytes).unwrap();unreachable!()}}}
I am not sure how to fix this. Here's a reproducer that works on top of 75a0517 in quick-
protobuf/src/reader.rs
.Found with #210.
The text was updated successfully, but these errors were encountered: