diff --git a/coreapi/bellesip_sal/sal_sdp.c b/coreapi/bellesip_sal/sal_sdp.c index 63a735717..34720f5b4 100644 --- a/coreapi/bellesip_sal/sal_sdp.c +++ b/coreapi/bellesip_sal/sal_sdp.c @@ -487,7 +487,9 @@ static void sdp_parse_media_ice_parameters(belle_sdp_media_description_t *media_ att_name = belle_sdp_attribute_get_name(attribute); value = belle_sdp_attribute_get_value(attribute); - if ((keywordcmp("candidate", att_name) == 0) && (value != NULL)) { + if ( (nb_ice_candidates < sizeof (stream->ice_candidates)/sizeof(SalIceCandidate)) + && (keywordcmp("candidate", att_name) == 0) + && (value != NULL)) { SalIceCandidate *candidate = &stream->ice_candidates[nb_ice_candidates]; char proto[4]; int nb = sscanf(value, "%s %u %3s %u %s %d typ %s raddr %s rport %d", diff --git a/include/sal/sal.h b/include/sal/sal.h index 47a5f71fc..43284179e 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -164,7 +164,7 @@ typedef struct SalIceCandidate { int rport; } SalIceCandidate; -#define SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES 10 +#define SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES 20 typedef struct SalIceRemoteCandidate { char addr[SAL_MEDIA_DESCRIPTION_MAX_ICE_ADDR_LEN];