db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r652211 - /db/derby/code/branches/10.3/java/drda/org/apache/derby/impl/drda/DDMReader.java
Date Wed, 30 Apr 2008 01:15:22 GMT
Author: kmarsden
Date: Tue Apr 29 18:15:22 2008
New Revision: 652211

URL: http://svn.apache.org/viewvc?rev=652211&view=rev
Log:
DERBY-2935 DDMReader.readLengthAndCodePoint() decodes long integer incorrectly

Contributed by Knut Anders Hatlen

port from trunk revision 557513

Modified:
    db/derby/code/branches/10.3/java/drda/org/apache/derby/impl/drda/DDMReader.java

Modified: db/derby/code/branches/10.3/java/drda/org/apache/derby/impl/drda/DDMReader.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/drda/org/apache/derby/impl/drda/DDMReader.java?rev=652211&r1=652210&r2=652211&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/drda/org/apache/derby/impl/drda/DDMReader.java (original)
+++ db/derby/code/branches/10.3/java/drda/org/apache/derby/impl/drda/DDMReader.java Tue Apr
29 18:15:22 2008
@@ -530,32 +530,32 @@
 			switch (numberOfExtendedLenBytes) {
 			case 8:
 				 ddmScalarLen =
-					((buffer[pos++] & 0xff) << 56) +
-					((buffer[pos++] & 0xff) << 48) +
-					((buffer[pos++] & 0xff) << 40) +
-					((buffer[pos++] & 0xff) << 32) +
-					((buffer[pos++] & 0xff) << 24) +
-					((buffer[pos++] & 0xff) << 16) +
-					((buffer[pos++] & 0xff) << 8) +
-					((buffer[pos++] & 0xff) << 0);
+					((buffer[pos++] & 0xFFL) << 56) +
+					((buffer[pos++] & 0xFFL) << 48) +
+					((buffer[pos++] & 0xFFL) << 40) +
+					((buffer[pos++] & 0xFFL) << 32) +
+					((buffer[pos++] & 0xFFL) << 24) +
+					((buffer[pos++] & 0xFFL) << 16) +
+					((buffer[pos++] & 0xFFL) << 8) +
+					((buffer[pos++] & 0xFFL) << 0);
 				adjustSize = 12;
 				break;
 			case 6:
 				ddmScalarLen =
-					((buffer[pos++] & 0xff) << 40) +
-					((buffer[pos++] & 0xff) << 32) +
-					((buffer[pos++] & 0xff) << 24) +
-					((buffer[pos++] & 0xff) << 16) +
-					((buffer[pos++] & 0xff) << 8) +
-					((buffer[pos++] & 0xff) << 0);
+					((buffer[pos++] & 0xFFL) << 40) +
+					((buffer[pos++] & 0xFFL) << 32) +
+					((buffer[pos++] & 0xFFL) << 24) +
+					((buffer[pos++] & 0xFFL) << 16) +
+					((buffer[pos++] & 0xFFL) << 8) +
+					((buffer[pos++] & 0xFFL) << 0);
 				adjustSize = 10;
 				break;
 			case 4:
 				ddmScalarLen =
-					((buffer[pos++] & 0xff) << 24) +
-					((buffer[pos++] & 0xff) << 16) +
-					((buffer[pos++] & 0xff) << 8) +
-					((buffer[pos++] & 0xff) << 0);
+					((buffer[pos++] & 0xFFL) << 24) +
+					((buffer[pos++] & 0xFFL) << 16) +
+					((buffer[pos++] & 0xFFL) << 8) +
+					((buffer[pos++] & 0xFFL) << 0);
 				adjustSize = 8;
 				break;
                 



Mime
View raw message