mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
consumption.
This commit is contained in:
		
						commit
						69fdbf9cb0
					
				
					 3 changed files with 36 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -862,6 +862,8 @@ def _read2(self, n):
 | 
			
		|||
 | 
			
		||||
        data = self._fileobj.read(n)
 | 
			
		||||
        self._compress_left -= len(data)
 | 
			
		||||
        if not data:
 | 
			
		||||
            raise EOFError
 | 
			
		||||
 | 
			
		||||
        if self._decrypter is not None:
 | 
			
		||||
            data = bytes(map(self._decrypter, data))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue