FS-10394: [freeswitch-core] FS Crash while linphone sends ICE packets

This commit is contained in:
Anthony Minessale 2017-06-28 11:32:24 -05:00
parent c7250805d6
commit 905703c907
1 changed files with 4 additions and 1 deletions

View File

@ -216,7 +216,7 @@ SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_parse(uint8_t *buf, ui
alen = switch_stun_attribute_padded_length(attr);
if (alen > (int)bytes_left || alen <= 0) {
if (alen > (int)bytes_left || alen < 0) {
/*
* Note we simply don't "break" here out of the loop anymore because
* we don't want the upper layers to have to deal with attributes without a value
@ -330,6 +330,9 @@ SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_parse(uint8_t *buf, ui
}
bytes_left -= alen; /* attribute value consumed, substract padded length */
if (alen == 0) break;
xlen += 4 + alen;
attr = (switch_stun_packet_attribute_t *) (attr->value + alen);