Skip to content

module-protocol-native: make demarshaling safe vs. reentering

P V requested to merge pvir/pipewire:fix-loop-reentering-3-list into master

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.

Merge request reports