-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b123
-
x86
-
windows_xp
-
Verified
FULL PRODUCT VERSION :
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
There is a bug in method javax.sql.rowset.serial.SerialBlob.getBytes.
Exception is always generated if passed length is smaller than passed pos. The reason is that when position argument is bound checked, length argument is mistakenly used instead of len.
Resolution:
Instead of :
if (pos < 1 || length - pos < 0 ) {
throw new SerialException("Invalid arguments: position cannot be less that 1");
}
write:
if (pos < 1 || len - pos < 0 ) {
throw new SerialException("Invalid arguments: position cannot be less that 1");
}
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
There is a bug in method javax.sql.rowset.serial.SerialBlob.getBytes.
Exception is always generated if passed length is smaller than passed pos. The reason is that when position argument is bound checked, length argument is mistakenly used instead of len.
Resolution:
Instead of :
if (pos < 1 || length - pos < 0 ) {
throw new SerialException("Invalid arguments: position cannot be less that 1");
}
write:
if (pos < 1 || len - pos < 0 ) {
throw new SerialException("Invalid arguments: position cannot be less that 1");
}
REPRODUCIBILITY :
This bug can be reproduced always.