db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r557513 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
Date Thu, 19 Jul 2007 07:49:57 GMT
Author: kahatlen
Date: Thu Jul 19 00:49:57 2007
New Revision: 557513

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

Use long arithmetic instead of int arithmetic.

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

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java?view=diff&rev=557513&r1=557512&r2=557513
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java Thu Jul 19 00:49:57
2007
@@ -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