Module: sip-router Branch: 4.1 Commit: 0b85493f3c1bc7c6cbd48f39aea9d3ecc135d4ff URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0b85493f...
Author: Richard Fuchs rfuchs@sipwise.com Committer: Richard Fuchs rfuchs@sipwise.com Date: Tue Nov 26 10:36:18 2013 -0500
rtpproxy-ng: remove trailing double \r\n from multipart SDP
---
modules/rtpproxy-ng/rtpproxy_funcs.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules/rtpproxy-ng/rtpproxy_funcs.c b/modules/rtpproxy-ng/rtpproxy_funcs.c index 1c283e5..3f7079e 100644 --- a/modules/rtpproxy-ng/rtpproxy_funcs.c +++ b/modules/rtpproxy-ng/rtpproxy_funcs.c @@ -257,7 +257,10 @@ int extract_body(struct sip_msg *msg, str *body ) } /* end of while */ if(c==1) { - while(rest && (*rest=='\r' || *rest=='\n')) rest++; + if (rest < p2 && *rest == '\r') rest++; + if (rest < p2 && *rest == '\n') rest++; + if (rest < p2 && p2[-1] == '\n') p2--; + if (rest < p2 && p2[-1] == '\r') p2--; body->s = rest; body->len = p2-rest; goto done;