Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding of STUN ERROR-CODE attribute. #13

Closed
wants to merge 1 commit into from
Closed

Fix encoding of STUN ERROR-CODE attribute. #13

wants to merge 1 commit into from

Conversation

jlaine
Copy link

@jlaine jlaine commented Jul 7, 2017

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

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
Copy link
Author

jlaine commented Jul 17, 2017

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
Copy link

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

@ghismary ghismary closed this Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants