OLD | NEW |
| (Empty) |
1 From 2049b591163feaa885b482132ea2c769f5ff5a8d Mon Sep 17 00:00:00 2001 | |
2 From: Evangelos Foutras <evangelos@foutrelis.com> | |
3 Date: Tue, 12 Jun 2012 18:13:09 +0000 | |
4 Subject: [PATCH 13/23] [fts3][backport] Fix out-of-scope reference. | |
5 | |
6 A pointer to a stack variable was being used after the variable's scope had | |
7 ended. | |
8 | |
9 Upstream commit http://www.sqlite.org/src/info/f9c4a7c8f4 | |
10 | |
11 BUG=122525 | |
12 | |
13 Original review URL: https://chromiumcodereview.appspot.com/10387026 | |
14 --- | |
15 third_party/sqlite/src/ext/fts3/fts3_write.c | 4 ++-- | |
16 1 file changed, 2 insertions(+), 2 deletions(-) | |
17 | |
18 diff --git a/third_party/sqlite/src/ext/fts3/fts3_write.c b/third_party/sqlite/s
rc/ext/fts3/fts3_write.c | |
19 index 1e71874..3636c7d 100644 | |
20 --- a/third_party/sqlite/src/ext/fts3/fts3_write.c | |
21 +++ b/third_party/sqlite/src/ext/fts3/fts3_write.c | |
22 @@ -1238,13 +1238,13 @@ int sqlite3Fts3SegReaderPending( | |
23 Fts3SegReader **ppReader /* OUT: SegReader for pending-terms */ | |
24 ){ | |
25 Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */ | |
26 + Fts3HashElem *pE; /* Iterator variable */ | |
27 Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */ | |
28 int nElem = 0; /* Size of array at aElem */ | |
29 int rc = SQLITE_OK; /* Return Code */ | |
30 | |
31 if( isPrefix ){ | |
32 int nAlloc = 0; /* Size of allocated array at aElem */ | |
33 - Fts3HashElem *pE = 0; /* Iterator variable */ | |
34 | |
35 for(pE=fts3HashFirst(&p->pendingTerms); pE; pE=fts3HashNext(pE)){ | |
36 char *zKey = (char *)fts3HashKey(pE); | |
37 @@ -1276,7 +1276,7 @@ int sqlite3Fts3SegReaderPending( | |
38 } | |
39 | |
40 }else{ | |
41 - Fts3HashElem *pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm); | |
42 + pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm); | |
43 if( pE ){ | |
44 aElem = &pE; | |
45 nElem = 1; | |
46 -- | |
47 2.2.1 | |
48 | |
OLD | NEW |