Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 11:20:53 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 11:20:53 +0400
commit4c9a11fbeb5a95c407c00bfe33f1b836078378ce (patch)
treeef905fca69c10e91b8eb1d855bd75068db799fda /core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java
parentd80f2c89d6953c0d2587e2985451b6ff44b35365 (diff)
Add checks on various lengths to make sure they aren't overflowing their
type
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java
index 693b7ac0..672c9360 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsSRTPUtils.java
@@ -39,7 +39,9 @@ public class TlsSRTPUtils
// SRTPProtectionProfiles
int[] protectionProfiles = useSRTPData.getProtectionProfiles();
- TlsUtils.writeUint16(2 * protectionProfiles.length, buf);
+ int length = 2 * protectionProfiles.length;
+ TlsUtils.checkUint16(length);
+ TlsUtils.writeUint16(length, buf);
TlsUtils.writeUint16Array(protectionProfiles, buf);
// srtp_mki