Skip to content

Commit cdd4725

Browse files
committed
rtp*: guard from empty to_tag
1 parent 1208555 commit cdd4725

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

modules/rtp_relay/rtp_relay_ctx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,9 +1657,9 @@ static void rtp_relay_fill_dlg(struct rtp_relay_ctx *ctx, str *dlg_callid,
16571657
LM_ERR("could not store dialog callid in context\n");
16581658
if (callid && !ctx->callid.len && shm_str_sync(&ctx->callid, callid) < 0)
16591659
LM_ERR("could not store callid in context\n");
1660-
if (from_tag && !ctx->from_tag.s && shm_str_sync(&ctx->from_tag, from_tag) < 0)
1660+
if (from_tag && from_tag->len && !ctx->from_tag.s && shm_str_sync(&ctx->from_tag, from_tag) < 0)
16611661
LM_ERR("could not store from tag in context\n");
1662-
if (to_tag && !ctx->to_tag.s && shm_str_sync(&ctx->to_tag, to_tag) < 0)
1662+
if (to_tag && to_tag->len && !ctx->to_tag.s && shm_str_sync(&ctx->to_tag, to_tag) < 0)
16631663
LM_ERR("could not store to tag in context\n");
16641664
}
16651665

modules/rtpengine/rtpengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5109,7 +5109,7 @@ static bencode_item_t *rtpengine_api_copy_op(struct rtp_relay_session *sess,
51095109
bencode_list_add_string(list, "all");
51105110
} else if (copy_flags & RTP_COPY_LEG_CALLER && sess->from_tag) {
51115111
bencode_dictionary_add_str(dict, "from-tag", sess->from_tag);
5112-
} else if (sess->to_tag) {
5112+
} else if (sess->to_tag && sess->to_tag->len) {
51135113
bencode_dictionary_add_str(dict, "from-tag", sess->to_tag);
51145114
}
51155115
if (copy_flags & RTP_COPY_MODE_DISABLE) {

0 commit comments

Comments
 (0)