[OpenSIPS-Devel] [ opensips-Bugs-3612563 ] OpenSIPS fails to parse MIME types containing numbers

SourceForge.net noreply at sourceforge.net
Tue May 7 11:52:02 CEST 2013


Bugs item #3612563, was opened at 2013-05-03 05:14
Message generated for change (Settings changed) made by vladut-paiu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3612563&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.8.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Víctor Fernández Martínez (vfm-barracuda)
>Assigned to: Vladut-Stefan Paiu (vladut-paiu)
Summary: OpenSIPS fails to parse MIME types containing numbers

Initial Comment:
Microsoft Lync uses several custom MIME types for its communication with the server. When OpenSIPS is used as a SIP proxy between the Lync client and the Lync server, the following error can be seen in the logs:

DBG:core:decode_mime_type: Decoding MIME type for:[application/vnd-microsoft-roaming-provisioning-v2+xml]
ERROR:core:decode_mime_type: parse error near in [application/vnd-microsoft-roaming-provisioning-v2+xml] char[50][2] offset
=48
DBG:core:set_err_info: ec: 1, el: 3, ei: 'error parsing CT-TYPE header'

This happens always in OpenSIPS 1.8.2. After taking a look at the source code, it is evident that decode_mime_type() doesn't accept digits (0-9) as valid characters in MIME types. This could easily be fixed by replacing the definition of is_mime_char() in parse_content.c with the following:

#define is_mime_char(_c_) \
	(isalnum((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.')

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3612563&group_id=232389



More information about the Devel mailing list