Skip to content

Commit

Permalink
Fix crash if hash in release notes is greater than 40 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
russellbanks committed Feb 20, 2024
1 parent b70d38b commit da7e5e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/release_notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ fn remove_sha1(input: &str) -> String {
let mut buffer = heapless::String::<SHA1_LEN>::new();

for character in input.chars() {
if character.is_ascii_hexdigit() {
if character.is_ascii_hexdigit() && buffer.len() < SHA1_LEN {
buffer.push(character).unwrap();
} else if buffer.len() == SHA1_LEN {
} else if !character.is_ascii_hexdigit() && buffer.len() == SHA1_LEN {
buffer.clear();
} else {
result.push_str(&buffer);
Expand Down

0 comments on commit da7e5e9

Please sign in to comment.