mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-14 08:18:04 +02:00
As Coverity points out, `ensure_size()` is not fully correct. Let us assume that the message already has some allocated storage, and the `realloc()` call in the next `ensure_size()` invocation fails. In that case `message::data` is freed, but the pointer is left behind. If another `ensure_size()` call is made, then `realloc()` will be called (since the previous call left `message::allocated` as zero), but the first argument of the `realloc()` call will be a dangling pointer. In order to avoid the above, first of all, clear `message::data` after a failed `realloc()` call, and immediately return `-ENOMEM` if `message::length` is greater than `message::allocated` since that signals if the message has even run into an out-of-memory situation. |
||
|---|---|---|
| .. | ||
| daemon | ||
| examples | ||
| gst | ||
| modules | ||
| pipewire | ||
| tests | ||
| tools | ||
| meson.build | ||