couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [1/2] couch commit: updated refs/heads/master to 2a66f41
Date Tue, 04 Oct 2016 14:51:54 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master f129308c4 -> 2a66f4142


Fix CouchJS character replacement

This was a bad backport from an old bug. We accidentally backed up when
looking at the second half of a surrogate pair. Instead the backup
should only happen when we see a low half of a surrogate pair with no
preceding high half.

COUCHDB-3173


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/37d37781
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/37d37781
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/37d37781

Branch: refs/heads/master
Commit: 37d3778172ca354f124334edf13bc09d9abc28bc
Parents: f129308
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Tue Oct 4 09:45:36 2016 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Tue Oct 4 09:45:36 2016 -0500

----------------------------------------------------------------------
 priv/couch_js/utf8.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/37d37781/priv/couch_js/utf8.c
----------------------------------------------------------------------
diff --git a/priv/couch_js/utf8.c b/priv/couch_js/utf8.c
index fcafff6..4cdb9c2 100644
--- a/priv/couch_js/utf8.c
+++ b/priv/couch_js/utf8.c
@@ -83,10 +83,10 @@ enc_charbuf(const jschar* src, size_t srclen, char* dst, size_t* dstlenp)
             {
                 // Invalid second half of surrogate pair
                 v = (uint32) 0xFFFD;
+                // Undo our character advancement
+                src--;
+                srclen++;
             }
-            // Undo our character advancement
-            src--;
-            srclen++;
         }
         else
         {


Mime
View raw message