mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pod: rework the parser
Make a new body.h file with some functions to deal with pod and their body. Make the iter.h functions use mostly this. Rework the parser so that it only uses body.h functions. With the separation of pod+body, we can read and verify the pod once and then use the verified copy to handle the rest of the body safely. We do this because iter.h only works in pods in memory that doesn't change because it is vulnerable to modifications of the data after verifying it. The new parser is not vulnerable to this and will not cause invalid memory access when used on shared memory. There is however no need for atomic operations to read the headers, whever is read is either valid and useable of invalid and rejected. See #4822
This commit is contained in:
parent
e2c291d18e
commit
e317edcfb9
16 changed files with 826 additions and 380 deletions
|
|
@ -129,6 +129,7 @@
|
|||
#include <spa/pod/dynamic.h>
|
||||
#include <spa/pod/event.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/pod/body.h>
|
||||
#include <spa/pod/iter.h>
|
||||
#include <spa/pod/parser.h>
|
||||
#include <spa/pod/pod.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue