let error propagate instead of panicking (#3754)

This commit is contained in:
samkim-crypto 2022-10-26 09:37:37 +09:00 committed by GitHub
parent 02b1265ec8
commit 12c11f6f9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -494,7 +494,7 @@ impl<'data, S: BaseState> StateWithExtensionsMut<'data, S> {
pod_from_bytes_mut::<Length>(&mut self.tlv_data[length_start..value_start])?;
// maybe this becomes smarter later for dynamically sized extensions
let length = pod_get_packed_len::<V>();
*length_ref = Length::try_from(length).unwrap();
*length_ref = Length::try_from(length)?;
let value_end = value_start.saturating_add(length);
let extension_ref =