Browse Source
			
			
			Fix dataurl parse panic when icon is malformed
			
			
				pull/3639/head
			
			
		 
		
			
				
					
						 Daniel García
					
					2 years ago
						Daniel García
					
					2 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: FC8A7D14C3CD543A
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
1 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					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| { | 
			
		
	
	
		
			
				
					|  |  | 
 |