Skip to content

Commit 73f66db

Browse files
committed
rtp*: guard from empty to_tag
(cherry picked from commit cdd4725)
1 parent 9cd22f0 commit 73f66db

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
@@ -1633,9 +1633,9 @@ static void rtp_relay_fill_dlg(struct rtp_relay_ctx *ctx, str *dlg_callid,
16331633
LM_ERR("could not store dialog callid in context\n");
16341634
if (callid && !ctx->callid.len && shm_str_sync(&ctx->callid, callid) < 0)
16351635
LM_ERR("could not store callid in context\n");
1636-
if (from_tag && !ctx->from_tag.s && shm_str_sync(&ctx->from_tag, from_tag) < 0)
1636+
if (from_tag && from_tag->len && !ctx->from_tag.s && shm_str_sync(&ctx->from_tag, from_tag) < 0)
16371637
LM_ERR("could not store from tag in context\n");
1638-
if (to_tag && !ctx->to_tag.s && shm_str_sync(&ctx->to_tag, to_tag) < 0)
1638+
if (to_tag && to_tag->len && !ctx->to_tag.s && shm_str_sync(&ctx->to_tag, to_tag) < 0)
16391639
LM_ERR("could not store to tag in context\n");
16401640
}
16411641

modules/rtpengine/rtpengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4389,7 +4389,7 @@ static bencode_item_t *rtpengine_api_copy_op(struct rtp_relay_session *sess,
43894389
bencode_list_add_string(list, "all");
43904390
} else if (copy_flags & RTP_COPY_LEG_CALLER && sess->from_tag) {
43914391
bencode_dictionary_add_str(dict, "from-tag", sess->from_tag);
4392-
} else if (sess->to_tag) {
4392+
} else if (sess->to_tag && sess->to_tag->len) {
43934393
bencode_dictionary_add_str(dict, "from-tag", sess->to_tag);
43944394
}
43954395
msg = (sess->msg?sess->msg:get_dummy_sip_msg());

0 commit comments

Comments
 (0)