mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-126461: Fix _Unpickler_ReadFromFile() error handling (#126485)
Handle _Unpickler_SetStringInput() failure.
This commit is contained in:
		
							parent
							
								
									9cba47d9f1
								
							
						
					
					
						commit
						a1c57bcfd2
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -1288,6 +1288,10 @@ _Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n) | |||
|             else { | ||||
|                 read_size = _Unpickler_SetStringInput(self, data); | ||||
|                 Py_DECREF(data); | ||||
|                 if (read_size < 0) { | ||||
|                     return -1; | ||||
|                 } | ||||
| 
 | ||||
|                 self->prefetched_idx = 0; | ||||
|                 if (n <= read_size) | ||||
|                     return n; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner