Relax check for unknown STUN attribute lengths

Bug: chromium:1155459
Change-Id: I51cb8162a989ba934e3292c86c3ecf749f26f601
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196500
Commit-Queue: Jonas Oreland <jonaso@google.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32773}
diff --git a/api/transport/stun.cc b/api/transport/stun.cc
index c3f589a..e1bf03b 100644
--- a/api/transport/stun.cc
+++ b/api/transport/stun.cc
@@ -33,6 +33,7 @@
 const int k127Utf8CharactersLengthInBytes = 508;
 const int kDefaultMaxAttributeLength = 508;
 const int kMessageIntegrityAttributeLength = 20;
+const int kTheoreticalMaximumAttributeLength = 65535;
 
 uint32_t ReduceTransactionId(const std::string& transaction_id) {
   RTC_DCHECK(transaction_id.length() == cricket::kStunTransactionIdLength ||
@@ -77,10 +78,10 @@
       // No length restriction in RFC; it's the content of an UDP datagram,
       // which in theory can be up to 65.535 bytes.
       // TODO(bugs.webrtc.org/12179): Write a test to find the real limit.
-      return length <= 65535;
+      return length <= kTheoreticalMaximumAttributeLength;
     default:
       // Return an arbitrary restriction for all other types.
-      return length <= kDefaultMaxAttributeLength;
+      return length <= kTheoreticalMaximumAttributeLength;
   }
   RTC_NOTREACHED();
   return true;