g_option_context_parse() modifies the argv given to it, so g_strfreev()
called during the cleanup cannot free all the strings that have been
duplicated by g_strdupv(). Make a second, shallow copy of the array, and
use that to free all the strings that were duplicated.
Change-Id: Ifcb31cb5e6141a1e15de47e11ab800c9d3e0ab10
The `if` block ends with a goto, so the indent for the `else` block is
not needed. Remove it for readability.
Change-Id: I0ab88246cfebf105c2256d129890925706917618
Previously there were explicit calls to fflush() in some code paths.
Replace with making the file fully unbuffered in case users depended on
this behaviour.
Change-Id: If49cf6135c0d9fe41c8896d4137e204da780be31
Re-move misleading log line to another place.
In the `sdp_manipulate_remove()` function:
- true - means remove
- false - means don't remove
Correct logging accordingly.
Change-Id: I3e0c08552a0192f3985da990b5f0c96cc31ece94
Convert existing sdp manipulation helpers
to work with arrays directly, independently from
which array is actually given.
Moreover, don't use the `G_N_ELEMENTS()`,
since we already have the `__MT_MAX`
as the size of the array, so we can directly use
that instead of relying on the G_N_ELEMENTS macro
(for array size checks).
Change-Id: I38e71dab30a467b933c213c8157fa06651ebaf04
Add a getter function for retrieval of top
most media from given media.
Currently existing getter for the top most
monologue's media subscription, just rename
so it makes more sense and is better to
differentiate:
`call_get_top_media_subscription()` -> `call_ml_get_top_ms()`
Change-Id: I5bf13b69b4d5f67cd6b53018b5a16d759542cd41
Add support for simplified G.107 formula, with math changed to
fixed-point. Retain legacy formula as an option for backwards
compatibility.
Change-Id: I999fc7de7be1407876c201c251538cea72b04008
Always create the offer/answer subscriptions during an offer/answer
exchange, making sure that no other offer/answer subscriptions can
exist.
Change-Id: I95e584c24e7ba74f2ead36d0c23976ef1f2e461c
Make sure stats are always added to the `delete` message.
Fixes stats being missing in case of `delete` without from-tag.
Change-Id: I635cc87b91d3e488696f33380b12dc68a24e51ad
The pcre2 API was changed from
pcre2_substring_list_free(PCRE2_SPTR *)
to
pcre2_substring_list_free(PCRE2_UCHAR **)
in 10.43. The difference is a `const` qualifier. Work around this.
Closes#1869
Change-Id: Ib3dd3003352f6c3155bb47d69ecb7a1b02f4647a
Fix the math in the sequencer code to determine ROC and extended
sequence number. This has become significant as the sequence numbers are
written into shared memory space.
Change-Id: I9e519a29a3822d02f7c389920ee0909b48828525
These functions expect a `rtpp_pos` argument, and while `str` is
compatible through the union, it lacks the second member of the struct,
which ends up uninitialised. Use the correct type through temporary
objects instead.
Change-Id: I0c553bdbb31c351346746b6072f2d424113bac5a
Don't proceed with the trickle updates in
case the required room, hence a call
hasn't been found.
Fixes Coverity Scan defect:
*** CID 1600057: Null pointer dereferences (NULL_RETURNS)
/daemon/janus.c: 1679 in janus_trickle()
1673 // ufrag can be given in-line or separately
1674 sp->ice_ufrag = cand->ufrag;
1675 if (!sp->ice_ufrag.len && ufrag)
1676 bencode_strdup_str(&ngbuf->buffer, &sp->ice_ufrag, ufrag);
1677
1678 // finally do the update
>>> CID 1600057: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a pointer that might be "NULL" "call" when calling "trickle_ice_update".
1679 trickle_ice_update(ngbuf, call, &flags, &streams);
1680
1681 return NULL;
1682 }
1683
1684
Change-Id: Ib2e293c2f99e914e3d02fe43d08160ec30892ae4
0f9dd5def2 introduced this check for `source_media`
which was only in use by `sdp_replace()` functionality.
`sdp_create()`'s one never really reaches it, even
in older implementation where `handle_sdp_media_attributes()`
was used.
So for now it has no use, just remove it.
Fixes:
*** CID 1600058: Control flow issues (DEADCODE)
/daemon/sdp.c: 2690 in print_sdp_media_section()
2684
2685 /* print sendrecv */
2686 if (!flags->original_sendrecv)
2687 append_attr_to_gstring(s, sdp_get_sendrecv(media), NULL, flags,
2688 media->type_id);
2689 else if (source_media)
>>> CID 1600058: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "append_attr_to_gstring(s, s...".
2690 append_attr_to_gstring(s, sdp_get_sendrecv(source_media), NULL, flags,
2691 media->type_id);
2692
2693 ps_rtcp = print_rtcp(s, media, rtp_ps_link, flags);
2694
2695 if (proto_is_rtp(media->protocol)) {
** CID 1600057: Null pointer dereferences (NULL_RETURNS)
Change-Id: I2d2ffbb0c9ecc0fae8890367754fbbd6e79e9c21