mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Issue #7541 - Handle multipart attachments to SIP messages - even if boundary is quoted.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4620,6 +4620,7 @@ static int find_sdp(struct sip_request *req)
|
|||||||
const char *search;
|
const char *search;
|
||||||
char *boundary;
|
char *boundary;
|
||||||
unsigned int x;
|
unsigned int x;
|
||||||
|
int boundaryisquoted = FALSE;
|
||||||
|
|
||||||
content_type = get_header(req, "Content-Type");
|
content_type = get_header(req, "Content-Type");
|
||||||
|
|
||||||
@@ -4639,15 +4640,24 @@ static int find_sdp(struct sip_request *req)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
search += 10;
|
search += 10;
|
||||||
|
|
||||||
if (ast_strlen_zero(search))
|
if (ast_strlen_zero(search))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* If the boundary is quoted with ", remove quote */
|
||||||
|
if (*search == '\"') {
|
||||||
|
search++;
|
||||||
|
boundaryisquoted = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* make a duplicate of the string, with two extra characters
|
/* make a duplicate of the string, with two extra characters
|
||||||
at the beginning */
|
at the beginning */
|
||||||
boundary = ast_strdupa(search - 2);
|
boundary = ast_strdupa(search - 2);
|
||||||
boundary[0] = boundary[1] = '-';
|
boundary[0] = boundary[1] = '-';
|
||||||
|
|
||||||
|
/* Remove final quote */
|
||||||
|
if (boundaryisquoted)
|
||||||
|
boundary[strlen(boundary) - 1] = '\0';
|
||||||
|
|
||||||
/* search for the boundary marker, but stop when there are not enough
|
/* search for the boundary marker, but stop when there are not enough
|
||||||
lines left for it, the Content-Type header and at least one line of
|
lines left for it, the Content-Type header and at least one line of
|
||||||
body */
|
body */
|
||||||
|
Reference in New Issue
Block a user