blob: 87aad3034727a1f7b750b00a3c041840e873850f [file] [log] [blame]
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Conrad Irwin <conrad.irwin@gmail.com>
Date: Wed, 2 Oct 2019 11:17:40 -0700
Subject: [PATCH 7/8] The nodeReaderInit() function in FTS3 may not assume that
the node is non-empty.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Backports https://www.sqlite.org/src/info/361eb2f682a303bb
Bug998494
---
third_party/sqlite/patched/ext/fts3/fts3_write.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/third_party/sqlite/patched/ext/fts3/fts3_write.c b/third_party/sqlite/patched/ext/fts3/fts3_write.c
index 4be6941579c5..6152c82871cf 100644
--- a/third_party/sqlite/patched/ext/fts3/fts3_write.c
+++ b/third_party/sqlite/patched/ext/fts3/fts3_write.c
@@ -3797,14 +3797,14 @@ static int nodeReaderInit(NodeReader *p, const char *aNode, int nNode){
p->nNode = nNode;
/* Figure out if this is a leaf or an internal node. */
- if( p->aNode[0] ){
+ if( aNode && aNode[0] ){
/* An internal node. */
p->iOff = 1 + sqlite3Fts3GetVarint(&p->aNode[1], &p->iChild);
}else{
p->iOff = 1;
}
- return nodeReaderNext(p);
+ return aNode ? nodeReaderNext(p) : SQLITE_OK;
}
/*
--
2.20.1 (Apple Git-117)