Skip to content

Commit

Permalink
rtpengine: get again body pointer only when read_sdp_pv is set
Browse files Browse the repository at this point in the history
- reported by GH #1434
  • Loading branch information
miconda committed Feb 8, 2018
1 parent 4244ccd commit 75c4ca0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/modules/rtpengine/rtpengine.c
Expand Up @@ -3351,12 +3351,17 @@ rtpengine_offer_answer(struct sip_msg *msg, const char *flags, int op, int more)
pkg_free(newbody.s);

} else {
/* get the body from the message as body ptr may have changed */
cur_body.len = 0;
cur_body.s = get_body(msg);
cur_body.len = msg->buf + msg->len - cur_body.s;

anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
if (read_sdp_pvar_str.len > 0) {
/* get the body from the message as body ptr may have changed
* when using read_sdp_pv */
cur_body.len = 0;
cur_body.s = get_body(msg);
cur_body.len = msg->buf + msg->len - cur_body.s;

anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
} else {
anchor = del_lump(msg, body.s - msg->buf, body.len, 0);
}
if (!anchor) {
LM_ERR("del_lump failed\n");
goto error_free;
Expand Down

0 comments on commit 75c4ca0

Please sign in to comment.