Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: third_party/sqlite/patches/0014-fts3-backport-Fix-misaligned-address-in-icu-tokenize.patch

Issue 885473002: [sql] Rewrite sqlite patching "system". (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo in readme. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/patches/0014-fts3-backport-Fix-misaligned-address-in-icu-tokenize.patch
diff --git a/third_party/sqlite/patches/0014-fts3-backport-Fix-misaligned-address-in-icu-tokenize.patch b/third_party/sqlite/patches/0014-fts3-backport-Fix-misaligned-address-in-icu-tokenize.patch
new file mode 100644
index 0000000000000000000000000000000000000000..3b56e8f43ee2a4e0373e93135690a34f2482172f
--- /dev/null
+++ b/third_party/sqlite/patches/0014-fts3-backport-Fix-misaligned-address-in-icu-tokenize.patch
@@ -0,0 +1,48 @@
+From b85e518f2640512763739bf8deabc993829a6cb2 Mon Sep 17 00:00:00 2001
+From: Xianzhu <wangxianzhu@chromium.org>
+Date: Thu, 18 Oct 2012 00:49:33 +0000
+Subject: [PATCH 14/23] [fts3][backport] Fix misaligned address in icu
+ tokenizer.
+
+Fix the problem that an int* pointer is assigned with a value calculated
+from a UChar* pointer and an offset. If the offset is odd, the int* pointer
+will not be 4-byte aligned which causes SIGBUS on some CPUs.
+
+Please see #9 and #10 in crbug.com/151673 for details.
+
+BUG=151673
+
+Original review URL: https://chromiumcodereview.appspot.com/11183042
+
+This is upstreamed at: http://sqlite.org/src/info/aaa2d9b0db
+---
+ third_party/sqlite/src/ext/fts3/fts3_icu.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/sqlite/src/ext/fts3/fts3_icu.c b/third_party/sqlite/src/ext/fts3/fts3_icu.c
+index a75b14a..e406168 100644
+--- a/third_party/sqlite/src/ext/fts3/fts3_icu.c
++++ b/third_party/sqlite/src/ext/fts3/fts3_icu.c
+@@ -118,15 +118,15 @@ static int icuOpen(
+ nChar = nInput+1;
+ pCsr = (IcuCursor *)sqlite3_malloc(
+ sizeof(IcuCursor) + /* IcuCursor */
+- nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
+- (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
++ (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
++ nChar * sizeof(UChar) /* IcuCursor.aChar[] */
+ );
+ if( !pCsr ){
+ return SQLITE_NOMEM;
+ }
+ memset(pCsr, 0, sizeof(IcuCursor));
+- pCsr->aChar = (UChar *)&pCsr[1];
+- pCsr->aOffset = (int *)&pCsr->aChar[nChar];
++ pCsr->aOffset = (int *)&pCsr[1];
++ pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
+
+ pCsr->aOffset[iOut] = iInput;
+ U8_NEXT(zInput, iInput, nInput, c);
+--
+2.2.1
+

Powered by Google App Engine
This is Rietveld 408576698