mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	module-protocol-native: make demarshaling safe vs. reentering
The message structures returned by pw_protocol_native_connection_get_next point to data that is contained in the buffer of the connection. The data was invalidated when pw_protocol_native_connection_get_next was called the next time, which made the connection loop non-reentrant, in cases where it was re-entered from demarshal callbacks. Fix this by allocating new buffers when reentering and stashing the old buffers onto a stack. The returned message structure is also stored on the stack to make lifetimes to match.
This commit is contained in:
		
							parent
							
								
									09a690b123
								
							
						
					
					
						commit
						23f010541f
					
				
					 3 changed files with 156 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -99,6 +99,9 @@ pw_protocol_native_connection_flush(struct pw_protocol_native_connection *conn);
 | 
			
		|||
int
 | 
			
		||||
pw_protocol_native_connection_clear(struct pw_protocol_native_connection *conn);
 | 
			
		||||
 | 
			
		||||
void pw_protocol_native_connection_enter(struct pw_protocol_native_connection *conn);
 | 
			
		||||
void pw_protocol_native_connection_leave(struct pw_protocol_native_connection *conn);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}  /* extern "C" */
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue