[sr-dev] git:master: parser/sdp: allow boundary value between quotes

Daniel-Constantin Mierla miconda at gmail.com
Wed Mar 14 10:59:42 CET 2012


Module: sip-router
Branch: master
Commit: a66242b4f776b43120014b0c56e21c87d254ddcc
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a66242b4f776b43120014b0c56e21c87d254ddcc

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Mar 14 10:57:47 2012 +0100

parser/sdp: allow boundary value between quotes

- reported by Magnus Nordström, FS#200

---

 parser/sdp/sdp_helpr_funcs.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/parser/sdp/sdp_helpr_funcs.c b/parser/sdp/sdp_helpr_funcs.c
index 32e9eb4..7779fff 100644
--- a/parser/sdp/sdp_helpr_funcs.c
+++ b/parser/sdp/sdp_helpr_funcs.c
@@ -179,6 +179,20 @@ int get_mixed_part_delimiter(str* body, str *mp_delimiter)
 		advance(p,1,str_type,error);
 	mp_delimiter->len = str_type.len - (int)(p-str_type.s);
 	mp_delimiter->s = p;
+	/* check if the boundary value is enclosed in quotes */
+	if(*p=='"' || *p=='\'') {
+		if(mp_delimiter->s[mp_delimiter->len-1]==*p) {
+			mp_delimiter->s = p+1;
+			mp_delimiter->len -= 2;
+			if(mp_delimiter->len<=0) {
+				LM_ERR("invalid boundary field value\n");
+				goto error;
+			}
+		} else {
+			LM_ERR("missing closing quote in boundary field value\n");
+			goto error;
+		}
+	}
 	return 1;
 
 error:  




More information about the sr-dev mailing list