Module: sip-router
Branch: master
Commit: dd3ce694280e9748740680a19837b530f48b5bc5
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=dd3ce69…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)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;