mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-09 08:21:08 -04:00
module-avb: fix potential NULL pointer dereference in MSRP/MVRP notify
The msrp_notify() and mvrp_notify() functions call dispatch table notify callbacks without checking for NULL. In MSRP, the TALKER_FAILED attribute type has a NULL notify callback, which would crash if a talker-failed attribute received a registrar state change notification (e.g. RX_NEW triggering NOTIFY_NEW). Add NULL checks before calling the dispatch notify callbacks, matching the defensive pattern used in the encode path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bdaecfebb8
commit
ef8f820d4a
2 changed files with 4 additions and 2 deletions
|
|
@ -332,7 +332,8 @@ static void msrp_notify(void *data, uint64_t now, uint8_t notify)
|
||||||
{
|
{
|
||||||
struct attr *a = data;
|
struct attr *a = data;
|
||||||
struct msrp *msrp = a->msrp;
|
struct msrp *msrp = a->msrp;
|
||||||
return dispatch[a->attr.type].notify(msrp, now, a, notify);
|
if (dispatch[a->attr.type].notify)
|
||||||
|
dispatch[a->attr.type].notify(msrp, now, a, notify);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct avb_mrp_attribute_events mrp_attr_events = {
|
static const struct avb_mrp_attribute_events mrp_attr_events = {
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,8 @@ static void mvrp_notify(void *data, uint64_t now, uint8_t notify)
|
||||||
{
|
{
|
||||||
struct attr *a = data;
|
struct attr *a = data;
|
||||||
struct mvrp *mvrp = a->mvrp;
|
struct mvrp *mvrp = a->mvrp;
|
||||||
return dispatch[a->attr.type].notify(mvrp, now, a, notify);
|
if (dispatch[a->attr.type].notify)
|
||||||
|
dispatch[a->attr.type].notify(mvrp, now, a, notify);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct avb_mrp_attribute_events mrp_attr_events = {
|
static const struct avb_mrp_attribute_events mrp_attr_events = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue