diff options
author | Daniel García <[email protected]> | 2023-07-03 20:20:26 +0200 |
---|---|---|
committer | Daniel García <[email protected]> | 2023-07-03 20:20:26 +0200 |
commit | 19e671ff25bffa47424b5af44264c2c74c2cc84b (patch) | |
tree | 991c55ab32e12d393c5aef60f8a0795ccd54eb2d | |
parent | 60964c07e6d178ae632d821e5698eee681f3d3c7 (diff) | |
download | vaultwarden-19e671ff25bffa47424b5af44264c2c74c2cc84b.tar.gz vaultwarden-19e671ff25bffa47424b5af44264c2c74c2cc84b.zip |
Fix dataurl parse panic when icon is malformed
-rw-r--r-- | src/api/icons.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/icons.rs b/src/api/icons.rs index e650386f..dcf985f7 100644 --- a/src/api/icons.rs +++ b/src/api/icons.rs @@ -682,7 +682,7 @@ async fn download_icon(domain: &str) -> Result<(Bytes, Option<&str>), Error> { for icon in icon_result.iconlist.iter().take(5) { if icon.href.starts_with("data:image") { - let datauri = DataUrl::process(&icon.href).unwrap(); + let Ok(datauri) = DataUrl::process(&icon.href) else {continue}; // Check if we are able to decode the data uri let mut body = BytesMut::new(); match datauri.decode::<_, ()>(|bytes| { |