Skip to content

Commit

Permalink
fix index out of bounds issue found by fuzz.
Browse files Browse the repository at this point in the history
fix #38

Signed-off-by: Yang, Longlong <[email protected]>
  • Loading branch information
longlongyang authored and jyao1 committed Feb 26, 2024
1 parent bd6c57a commit 7c61e7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spdmlib/src/crypto/x509v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ fn check_and_get_extn_id(extn_sequences: &[u8]) -> SpdmResult<(&[u8], usize)> {
} else {
// extnID is the first item in the extension sequence and the tag is Object identifier
let extn_id = &extn_sequences[1 + extn_bytes_consumed..];
if extn_id[0] != ASN1_TAG_NUMBER_OBJECT_IDENTIFIER {
if extn_id.is_empty() || extn_id[0] != ASN1_TAG_NUMBER_OBJECT_IDENTIFIER {
Err(SPDM_STATUS_VERIF_FAIL)
} else {
let (extn_id_length, extn_id_bytes_consumed) = check_length(&extn_id[1..])?;
Expand Down

0 comments on commit 7c61e7e

Please sign in to comment.