mirror of
				https://github.com/msgpack/msgpack-python.git
				synced 2025-11-04 03:20:56 +00:00 
			
		
		
		
	A segfault fixed in the issue https://github.com/msgpack/msgpack-python/issues/28
This commit is contained in:
		
							parent
							
								
									d5f99959cc
								
							
						
					
					
						commit
						89ce16df39
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -207,6 +207,9 @@ static inline int template_callback_map_end(unpack_user* u, msgpack_unpack_objec
 | 
			
		|||
{
 | 
			
		||||
    if (u->object_hook) {
 | 
			
		||||
        PyObject *new_c = PyEval_CallFunction(u->object_hook, "(O)", *c);
 | 
			
		||||
        if (!new_c)
 | 
			
		||||
            return -1;
 | 
			
		||||
 | 
			
		||||
        Py_DECREF(*c);
 | 
			
		||||
        *c = new_c;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -361,7 +361,7 @@ _push:
 | 
			
		|||
		if(construct_cb(_map_item)(user, c->count, &c->obj, c->map_key, obj) < 0) { goto _failed; }
 | 
			
		||||
		if(++c->count == c->size) {
 | 
			
		||||
			obj = c->obj;
 | 
			
		||||
			construct_cb(_map_end)(user, &obj);
 | 
			
		||||
			if (construct_cb(_map_end)(user, &obj) < 0) { goto _failed; }
 | 
			
		||||
			--top;
 | 
			
		||||
			/*printf("stack pop %d\n", top);*/
 | 
			
		||||
			goto _push;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue