Skip to content

Commit

Permalink
MT#55283 fix use-after-free
Browse files Browse the repository at this point in the history
Grab the correct list link when inserting in the middle of the list.

Change-Id: I4ae484ba05f5e4be827101193952653c21c47ad3
(cherry picked from commit 3f5a22d)
(cherry picked from commit 77738f1)
  • Loading branch information
rfuchs committed Nov 7, 2023
1 parent 86dcd49 commit 94c6f8e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions daemon/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4263,11 +4263,14 @@ static void codec_store_add_raw_link(struct codec_store *cs, struct rtp_payload_
STR_FMT(&pt->encoding_with_full_params), link);
g_hash_table_insert(cs->codecs, GINT_TO_POINTER(pt->payload_type), pt);
__rtp_payload_type_add_name(cs->codec_names, pt);
if (!link)
if (!link) {
g_queue_push_tail(&cs->codec_prefs, pt);
else
pt->prefs_link = cs->codec_prefs.tail;
}
else {
g_queue_insert_before(&cs->codec_prefs, link, pt);
pt->prefs_link = cs->codec_prefs.tail;
pt->prefs_link = link->prev;
}
if (!cs->supp_link && pt->codec_def && pt->codec_def->supplemental)
cs->supp_link = pt->prefs_link;
}
Expand Down

0 comments on commit 94c6f8e

Please sign in to comment.