cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [1/4] cassandra git commit: Fix UTF8Validator.validate() for modified UTF-8
Date Thu, 17 Mar 2016 13:34:04 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 6a8c747c6 -> 645829214


Fix UTF8Validator.validate() for modified UTF-8

patch by Benjamin Lerer; reviewed by Sylvain Lebresne for CASSANDRA-10748


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/42cd66a1
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/42cd66a1
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/42cd66a1

Branch: refs/heads/trunk
Commit: 42cd66a1f91dcd0cf9238e7915d5efe5779b9933
Parents: 5e2d3d2
Author: Benjamin Lerer <b.lerer@gmail.com>
Authored: Thu Mar 17 14:27:27 2016 +0100
Committer: Benjamin Lerer <b.lerer@gmail.com>
Committed: Thu Mar 17 14:27:27 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 src/java/org/apache/cassandra/serializers/UTF8Serializer.java | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/42cd66a1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fdb5807..fa4a726 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.6
+ * Fix UTF8Validator.validate() for modified UTF-8 (CASSANDRA-10748)
  * Clarify that now() function is calculated on the coordinator node in CQL documentation
(CASSANDRA-10900)
  * Fix bloom filter sizing with LCS (CASSANDRA-11344)
  * (cqlsh) Fix error when result is 0 rows with EXPAND ON (CASSANDRA-11092)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/42cd66a1/src/java/org/apache/cassandra/serializers/UTF8Serializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/serializers/UTF8Serializer.java b/src/java/org/apache/cassandra/serializers/UTF8Serializer.java
index be5d2d6..e3ea2d5 100644
--- a/src/java/org/apache/cassandra/serializers/UTF8Serializer.java
+++ b/src/java/org/apache/cassandra/serializers/UTF8Serializer.java
@@ -71,11 +71,12 @@ public class UTF8Serializer extends AbstractTextSerializer
                         {
                             // validate first byte of 2-byte char, 0xc2-0xdf
                             if (b == (byte) 0xc0)
-                                // speical case: modified utf8 null is 0xc080.
+                                // special case: modified utf8 null is 0xc080.
                                 state = State.TWO_80;
                             else if ((b & 0x1e) == 0)
                                 return false;
-                            state = State.TWO;
+                            else
+                                state = State.TWO;
                         }
                         else if ((b >> 4) == -2)
                         {


Mime
View raw message