src/pxar/decoder.rs: correctly read, check and skip filename
The previous implementation simply skipped over `size` bytes, which is not correct as size includes also the header. By relying on `SequentailDecoder`s read_filename function, this is correctly taken care of plus some more integrity checks. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
		
				
					committed by
					
						
						Dietmar Maurer
					
				
			
			
				
	
			
			
			
						parent
						
							4a7de56e2f
						
					
				
				
					commit
					ac30bc3326
				
			@ -305,7 +305,7 @@ impl<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<R, F> {
 | 
			
		||||
 | 
			
		||||
        if marker == PXAR_FILENAME {
 | 
			
		||||
            let size: u64 = self.inner.read_item()?;
 | 
			
		||||
            let _bytes = self.inner.skip_bytes(usize::try_from(size)?)?;
 | 
			
		||||
            let _filename = self.inner.read_filename(size)?;
 | 
			
		||||
            marker = self.inner.read_item()?;
 | 
			
		||||
        }
 | 
			
		||||
        if marker != PXAR_ENTRY {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user