changeset 53124:205d2db1dc25

8203654: Improve cypher state updates Reviewed-by: ascarpino
author valeriep
date Thu, 14 Jun 2018 23:47:05 +0000
parents 4aa8fe00ace9
children ee7b0da99262
files src/java.base/share/classes/javax/crypto/spec/GCMParameterSpec.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/javax/crypto/spec/GCMParameterSpec.java	Tue Dec 11 08:05:38 2018 +0800
+++ b/src/java.base/share/classes/javax/crypto/spec/GCMParameterSpec.java	Thu Jun 14 23:47:05 2018 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -120,7 +120,7 @@
 
         // Input sanity check
         if ((src == null) ||(len < 0) || (offset < 0)
-                || ((len + offset) > src.length)) {
+                || (len > (src.length - offset))) {
             throw new IllegalArgumentException("Invalid buffer arguments");
         }