]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't overrun buffer (FSCORE-95)
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 24 Jan 2008 16:01:25 +0000 (16:01 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 24 Jan 2008 16:01:25 +0000 (16:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7346 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_stun.c

index 1333335830c93cb5575d9b0a62a3fc7190e159f8..37e6f973bbd15c848bd68dd2be73d420d6d8d41a 100644 (file)
@@ -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);
 }