# HG changeset patch # User lancea # Date 1291917674 18000 # Node ID 85a0e84bb9a0cb2c5b361049f5f3f8a8d92777a4 # Parent 3a3e3f73b04332ac94769f9aef8863b8e9e0bf6b 6659234: Incorrect check in SerialBlob.getBytes Reviewed-by: darcy diff -r 3a3e3f73b043 -r 85a0e84bb9a0 jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Wed Dec 08 20:11:31 2010 -0800 +++ b/jdk/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