jdk/src/share/classes/java/security/Signature.java
changeset 12875 43a1cd4cfc32
parent 10709 d865c9f21240
child 18181 4f0a36582461
--- a/jdk/src/share/classes/java/security/Signature.java	Wed Jun 06 18:18:58 2012 -0700
+++ b/jdk/src/share/classes/java/security/Signature.java	Wed Jun 06 18:39:09 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, 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
@@ -658,7 +658,7 @@
         throws SignatureException {
         if (state == VERIFY) {
             if ((signature == null) || (offset < 0) || (length < 0) ||
-                (offset + length > signature.length)) {
+                (length > signature.length - offset)) {
                 throw new IllegalArgumentException("Bad arguments");
             }