提交 52500910 编写于 作者: L lancea

6659234: Incorrect check in SerialBlob.getBytes

Reviewed-by: darcy
上级 65c1dfca
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -166,8 +166,9 @@ public class SerialBlob implements Blob, Serializable, Cloneable { ...@@ -166,8 +166,9 @@ public class SerialBlob implements Blob, Serializable, Cloneable {
length = (int)len; length = (int)len;
} }
if (pos < 1 || length - pos < 0 ) { if (pos < 1 || len - pos < 0 ) {
throw new SerialException("Invalid arguments: position cannot be less that 1"); 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 pos--; // correct pos to array index
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册