Issue Details (XML | Word | Printable)

Key: DERBY-121
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: A B
Reporter: Lynh Nguyen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Network Server reading blob/clob data size

Created: 15/Jan/05 11:13 AM   Updated: 04/Jun/05 04:30 PM
Return to search
Component/s: Network Server
Affects Version/s: 10.1.1.0
Fix Version/s: 10.1.1.0

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-121_2.stat 2005-06-03 03:21 AM A B 1 kB
Text File Licensed for inclusion in ASF works derby-121_3.patch 2005-06-03 05:44 AM A B 20 kB
Environment: The is a bit shift typo in Network Server reading clob/blob data size

Resolution Date: 04/Jun/05 04:30 PM


 Description  « Hide
in DDMReader.java
...
... readLengthAndCodePoint() ... {
...

switch (numberOfExtendedLenBytes) {
case 8:
ddmScalarLen =
((buffer[pos++] & 0xff) << 64) +
((buffer[pos++] & 0xff) << 56) +
((buffer[pos++] & 0xff) << 48) +
((buffer[pos++] & 0xff) << 40) +
((buffer[pos++] & 0xff) << 32) +
((buffer[pos++] & 0xff) << 16) +
((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
adjustSize = 12;
break;
case 6:
ddmScalarLen =
((buffer[pos++] & 0xff) << 48) +
((buffer[pos++] & 0xff) << 40) +
((buffer[pos++] & 0xff) << 32) +
((buffer[pos++] & 0xff) << 16) +
((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
adjustSize = 10;
break;
case 4:
ddmScalarLen =
((buffer[pos++] & 0xff) << 32) +
((buffer[pos++] & 0xff) << 16) +
((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
adjustSize = 8;
break;
...
The shift bits should be in order:
0,8,16,24
0,8,16,24,32,40
0,8,16,24,32,40,48,56

This will only affect a lob if its length requires at least 24 bits--i.e. if the lob has a length of at least 2^24 bytes.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.