Skip to content

Commit

Permalink
Merge pull request #856 from notriddle/notriddle/escaped-link-fuzz-utf8
Browse files Browse the repository at this point in the history
commonmark_js fuzz: fix spurious failure with non-utf8 link
  • Loading branch information
Martin1887 committed Mar 2, 2024
2 parents 86c5ff3 + 8c8d269 commit e727173
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result<Vec<Event>> {
.try_get_attribute("destination")?
.ok_or(anyhow!("Missing destination"))?
.unescape_value()?;
let dest_url = urldecode(&url_encoded_dest_url)?.into_owned().into();
let dest_url = urldecode(&url_encoded_dest_url)
.unwrap_or_else(|_| url_encoded_dest_url.clone().into())
.into_owned().into();
let title = match tag.try_get_attribute("title")? {
Some(title) => title.unescape_value()?.into_owned().into(),
None => "".into(),
Expand Down

0 comments on commit e727173

Please sign in to comment.