Commit b257672b authored by Michael Olbrich's avatar Michael Olbrich Committed by Olivier Crête

stun: check identifier before using it

By default, 'candidate_identifier == NULL' only happens for 'compatibility
== NICE_COMPATIBILITY_GOOGLE'. However, keepalive=true will also trigger
the same code path so candidate_identifier must be checked to avoid a
segfault.
parent 2ef4bd7b
......@@ -100,7 +100,8 @@ stun_usage_ice_conncheck_create (StunAgent *agent, StunMessage *msg,
return 0;
}
if (compatibility == STUN_USAGE_ICE_COMPATIBILITY_MSICE2) {
if (compatibility == STUN_USAGE_ICE_COMPATIBILITY_MSICE2 &&
candidate_identifier) {
size_t identifier_len = strlen(candidate_identifier);
size_t attribute_len = identifier_len;
int modulo4 = identifier_len % 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment