From: Michael Olbrich Date: Mon, 9 Jul 2018 13:08:15 +0000 (+0200) Subject: stun: check identifier before using it X-Git-Tag: 0.1.15~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b257672b46b00fb5a6a5984ead069e60e5b3d00c;p=platform%2Fupstream%2Flibnice.git 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. --- diff --git a/stun/usages/ice.c b/stun/usages/ice.c index 47d998b..2d76ff0 100644 --- a/stun/usages/ice.c +++ b/stun/usages/ice.c @@ -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;