changeset 3229:1bf378034d39

6659234: Incorrect check in SerialBlob.getBytes Reviewed-by: darcy
author lancea
date Thu, 09 Dec 2010 13:01:14 -0500
parents 03513756704c
children 79947a4ad7a1
files src/share/classes/javax/sql/rowset/serial/SerialBlob.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/sql/rowset/serial/SerialBlob.java	Wed Dec 08 20:11:31 2010 -0800
+++ b/src/share/classes/javax/sql/rowset/serial/SerialBlob.java	Thu Dec 09 13:01:14 2010 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
@@ -166,8 +166,9 @@
             length = (int)len;
         }
 
-        if (pos < 1 || length - pos < 0 ) {
-            throw new SerialException("Invalid arguments: position cannot be less that 1");
+        if (pos < 1 || len - pos < 0 ) {
+            throw new SerialException("Invalid arguments: position cannot be "
+                    + "less than 1 or greater than the length of the SerialBlob");
         }
 
         pos--; // correct pos to array index