BelledonneCommunications / mediastreamer2

Linphone.org mirror for mediastreamer2 (git://git.linphone.org/mediastreamer2.git)
http://linphone.org
GNU Affero General Public License v3.0
133 stars 104 forks source link

Fix encoding of STUN ERROR-CODE attribute. #13

Closed jlaine closed 7 years ago

jlaine commented 7 years ago

When encode_error_code is invoked with a reason, for example "Role Conflict", the reason ERROR-CODE attribute is encoded with incorrect padding (always 0 bytes of padding).

The reason is that the padding calculation is done before the strlen() call to determine the reason length.

This was discovered while investigating a FreeSwitch crash:

https://freeswitch.org/jira/browse/FS-10394

jlaine commented 7 years ago

A consequence of this issue is that role conflicts are never reported correctly to the remote party, so I suspect ICE is partially broken regardless of the UA on the other side.

ghismary commented 7 years ago

Thanks for discovering this issue and proposing a patch. This has been fixed in revision d74adb5e356b5cde0a715ea88f8fbfe219817e94