mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Issue #18552: Check return value of PyArena_AddPyObject() in obj2ast_object().
This commit is contained in:
		
							parent
							
								
									1acc129d48
								
							
						
					
					
						commit
						70c94e7896
					
				
					 3 changed files with 17 additions and 6 deletions
				
			
		| 
						 | 
					@ -12,6 +12,9 @@ What's New in Python 3.3.3 release candidate 1?
 | 
				
			||||||
Core and Builtins
 | 
					Core and Builtins
 | 
				
			||||||
-----------------
 | 
					-----------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Issue #18552: Check return value of PyArena_AddPyObject() in
 | 
				
			||||||
 | 
					  obj2ast_object().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Issue #18560: Fix potential NULL pointer dereference in sum().
 | 
					- Issue #18560: Fix potential NULL pointer dereference in sum().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
 | 
					- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -834,9 +834,13 @@ def visitModule(self, mod):
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (obj == Py_None)
 | 
					    if (obj == Py_None)
 | 
				
			||||||
        obj = NULL;
 | 
					        obj = NULL;
 | 
				
			||||||
    if (obj)
 | 
					    if (obj) {
 | 
				
			||||||
        PyArena_AddPyObject(arena, obj);
 | 
					        if (PyArena_AddPyObject(arena, obj) < 0) {
 | 
				
			||||||
    Py_XINCREF(obj);
 | 
					            *out = NULL;
 | 
				
			||||||
 | 
					            return -1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        Py_INCREF(obj);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    *out = obj;
 | 
					    *out = obj;
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -688,9 +688,13 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (obj == Py_None)
 | 
					    if (obj == Py_None)
 | 
				
			||||||
        obj = NULL;
 | 
					        obj = NULL;
 | 
				
			||||||
    if (obj)
 | 
					    if (obj) {
 | 
				
			||||||
        PyArena_AddPyObject(arena, obj);
 | 
					        if (PyArena_AddPyObject(arena, obj) < 0) {
 | 
				
			||||||
    Py_XINCREF(obj);
 | 
					            *out = NULL;
 | 
				
			||||||
 | 
					            return -1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        Py_INCREF(obj);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    *out = obj;
 | 
					    *out = obj;
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue