mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Prevent access outside buffer (GH-26012)
This commit is contained in:
		
							parent
							
								
									8e8307d70b
								
							
						
					
					
						commit
						45862f9f5e
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -4794,8 +4794,10 @@ scan_back_to_entry_start(unsigned char *p) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static inline unsigned char * | static inline unsigned char * | ||||||
| skip_to_next_entry(unsigned char *p) { | skip_to_next_entry(unsigned char *p, unsigned char *end) { | ||||||
|     for (; (p[0]&128) == 0; p++); |     while (p < end && ((p[0] & 128) == 0)) { | ||||||
|  |         p++; | ||||||
|  |     } | ||||||
|     return p; |     return p; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -4863,7 +4865,7 @@ get_exception_handler(PyCodeObject *code, int index) | ||||||
|             parse_block(scan, &res); |             parse_block(scan, &res); | ||||||
|             return res; |             return res; | ||||||
|         } |         } | ||||||
|         scan = skip_to_next_entry(scan); |         scan = skip_to_next_entry(scan, end); | ||||||
|     } |     } | ||||||
|     res.b_handler = -1; |     res.b_handler = -1; | ||||||
|     return res; |     return res; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dennis Sweeney
						Dennis Sweeney