Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1446418131 for ; Thu, 17 Mar 2016 13:34:10 +0000 (UTC) Received: (qmail 32113 invoked by uid 500); 17 Mar 2016 13:34:06 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 31995 invoked by uid 500); 17 Mar 2016 13:34:06 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 31932 invoked by uid 99); 17 Mar 2016 13:34:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Mar 2016 13:34:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9F40FDFBD5; Thu, 17 Mar 2016 13:34:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: blerer@apache.org To: commits@cassandra.apache.org Date: Thu, 17 Mar 2016 13:34:04 -0000 Message-Id: <28eac0db0e9a473f9a33595b53ddc6cd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/4] cassandra git commit: Fix UTF8Validator.validate() for modified UTF-8 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 Authored: Thu Mar 17 14:27:27 2016 +0100 Committer: Benjamin Lerer 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) {