diff --git a/src/switch_stun.c b/src/switch_stun.c index 1333335830..37e6f973bb 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -198,7 +198,7 @@ SWITCH_DECLARE(char *) switch_stun_packet_attribute_get_username(switch_stun_pac { uint16_t cpylen; - cpylen = attribute->length > len ? attribute->length : len; + cpylen = attribute->length < len ? attribute->length : len; return memcpy(username, attribute->value, cpylen); }