From ee1095be9dac63f34ffedddb1db624f6c872165f Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 2 Jul 2026 12:08:52 +0000 Subject: [PATCH] chore: update quick-xml to 0.41.0 Fixes cargo-deny complaining about https://rustsec.org/advisories/RUSTSEC-2026-0194 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/configure/auto_mozilla.rs | 9 +++++++-- src/configure/auto_outlook.rs | 5 +++-- src/dehtml.rs | 6 +++--- src/location.rs | 10 ++++++---- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a384b262..2d8723b4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4785,9 +4785,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quick-xml" -version = "0.39.2" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 550438b41..e4eba3b68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ percent-encoding = "2.3" pgp = { version = "0.20.0", features = ["draft-pqc"], default-features = false } pin-project = "1" qrcodegen = "1.7.0" -quick-xml = { version = "0.39", features = ["escape-html"] } +quick-xml = { version = "0.41", features = ["escape-html"] } rand-old = { package = "rand", version = "0.8" } rand = { workspace = true } regex = { workspace = true } diff --git a/src/configure/auto_mozilla.rs b/src/configure/auto_mozilla.rs index c74b9b644..1d9960ba6 100644 --- a/src/configure/auto_mozilla.rs +++ b/src/configure/auto_mozilla.rs @@ -5,6 +5,7 @@ use std::io::BufRead; use std::str::FromStr; +use quick_xml::XmlVersion; use quick_xml::events::{BytesStart, Event}; use super::{Error, ServerParams}; @@ -71,7 +72,7 @@ fn parse_server( }) }) .map(|typ| { - typ.decode_and_unescape_value(reader.decoder()) + typ.decoded_and_normalized_value(XmlVersion::Implicit1_0, reader.decoder()) .unwrap_or_default() .to_lowercase() }) @@ -101,7 +102,11 @@ fn parse_server( } } Event::Text(ref event) => { - let val = event.xml_content().unwrap_or_default().trim().to_owned(); + let val = event + .xml_content(XmlVersion::Implicit1_0) + .unwrap_or_default() + .trim() + .to_owned(); match tag_config { MozConfigTag::Hostname => hostname = Some(val), diff --git a/src/configure/auto_outlook.rs b/src/configure/auto_outlook.rs index 8db39a612..11e665458 100644 --- a/src/configure/auto_outlook.rs +++ b/src/configure/auto_outlook.rs @@ -5,6 +5,7 @@ use std::io::BufRead; +use quick_xml::XmlVersion; use quick_xml::events::Event; use super::{Error, ServerParams}; @@ -79,7 +80,7 @@ fn parse_protocol( } } Event::Text(ref e) => { - let val = e.xml_content().unwrap_or_default(); + let val = e.xml_content(XmlVersion::Implicit1_0).unwrap_or_default(); if let Some(ref tag) = current_tag { match tag.as_str() { @@ -123,7 +124,7 @@ fn parse_redirecturl( let mut buf = Vec::new(); match reader.read_event_into(&mut buf)? { Event::Text(ref e) => { - let val = e.xml_content().unwrap_or_default(); + let val = e.xml_content(XmlVersion::Implicit1_0).unwrap_or_default(); Ok(val.trim().to_string()) } _ => Ok("".to_string()), diff --git a/src/dehtml.rs b/src/dehtml.rs index 43ade717e..3ea2eae22 100644 --- a/src/dehtml.rs +++ b/src/dehtml.rs @@ -6,7 +6,7 @@ use std::io::BufRead; use std::sync::LazyLock; use quick_xml::{ - Reader, + Reader, XmlVersion, errors::Error as QuickXmlError, events::{BytesEnd, BytesStart, BytesText}, }; @@ -327,7 +327,7 @@ fn dehtml_starttag_cb( }) { let href = href - .decode_and_unescape_value(reader.decoder()) + .decoded_and_normalized_value(XmlVersion::Implicit1_0, reader.decoder()) .unwrap_or_default() .to_string(); @@ -374,7 +374,7 @@ fn maybe_push_tag( fn tag_contains_attr(event: &BytesStart, reader: &Reader, name: &str) -> bool { event.attributes().any(|r| { r.map(|a| { - a.decode_and_unescape_value(reader.decoder()) + a.decoded_and_normalized_value(XmlVersion::Implicit1_0, reader.decoder()) .map(|v| v == name) .unwrap_or(false) }) diff --git a/src/location.rs b/src/location.rs index 7932e1406..c187cb2d4 100644 --- a/src/location.rs +++ b/src/location.rs @@ -14,6 +14,7 @@ use std::time::Duration; use anyhow::{Context as _, Result, ensure}; use async_channel::Receiver; +use quick_xml::XmlVersion; use quick_xml::events::{BytesEnd, BytesStart, BytesText}; use tokio::time::timeout; @@ -140,8 +141,9 @@ impl Kml { if self.tag == KmlTag::PlacemarkTimestampWhen || self.tag == KmlTag::PlacemarkPointCoordinates { - let val = event.xml_content().unwrap_or_default(); - + let val = event + .xml_content(XmlVersion::Implicit1_0) + .unwrap_or_default(); let val = val.replace(['\n', '\r', '\t', ' '], ""); if self.tag == KmlTag::PlacemarkTimestampWhen && val.len() >= 19 { @@ -227,7 +229,7 @@ impl Kml { == "addr" }) { self.addr = addr - .decode_and_unescape_value(reader.decoder()) + .decoded_and_normalized_value(XmlVersion::Implicit1_0, reader.decoder()) .ok() .map(|a| a.into_owned()); } @@ -253,7 +255,7 @@ impl Kml { }) }) { let v = acc - .decode_and_unescape_value(reader.decoder()) + .decoded_and_normalized_value(XmlVersion::Implicit1_0, reader.decoder()) .unwrap_or_default(); self.curr.accuracy = v.trim().parse().unwrap_or_default();