OLD | NEW |
---|---|
1 /* | 1 /* |
2 ** 2006 Oct 10 | 2 ** 2006 Oct 10 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 4699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4710 */ | 4710 */ |
4711 if( pReader->nData==0 ){ | 4711 if( pReader->nData==0 ){ |
4712 dataBufferReset(&pReader->term); | 4712 dataBufferReset(&pReader->term); |
4713 }else{ | 4713 }else{ |
4714 int n, nPrefix, nSuffix; | 4714 int n, nPrefix, nSuffix; |
4715 | 4715 |
4716 n = fts3GetVarint32Safe(pReader->pData, &nPrefix, pReader->nData); | 4716 n = fts3GetVarint32Safe(pReader->pData, &nPrefix, pReader->nData); |
4717 if( !n ) return SQLITE_CORRUPT_BKPT; | 4717 if( !n ) return SQLITE_CORRUPT_BKPT; |
4718 pReader->nData -= n; | 4718 pReader->nData -= n; |
4719 pReader->pData += n; | 4719 pReader->pData += n; |
4720 n += fts3GetVarint32Safe(pReader->pData, &nSuffix, pReader->nData); | 4720 n = fts3GetVarint32Safe(pReader->pData, &nSuffix, pReader->nData); |
Scott Hess - ex-Googler
2010/07/03 01:37:26
I believe I complained about that exact line of co
| |
4721 if( !n ) return SQLITE_CORRUPT_BKPT; | 4721 if( !n ) return SQLITE_CORRUPT_BKPT; |
4722 pReader->nData -= n; | 4722 pReader->nData -= n; |
4723 pReader->pData += n; | 4723 pReader->pData += n; |
4724 if( nSuffix<0 || nSuffix>pReader->nData ) return SQLITE_CORRUPT_BKPT; | 4724 if( nSuffix<0 || nSuffix>pReader->nData ) return SQLITE_CORRUPT_BKPT; |
4725 if( nPrefix<0 || nPrefix>pReader->term.nData ) return SQLITE_CORRUPT_BKPT; | 4725 if( nPrefix<0 || nPrefix>pReader->term.nData ) return SQLITE_CORRUPT_BKPT; |
4726 | 4726 |
4727 /* Truncate the current term and append suffix data. */ | 4727 /* Truncate the current term and append suffix data. */ |
4728 pReader->term.nData = nPrefix; | 4728 pReader->term.nData = nPrefix; |
4729 dataBufferAppend(&pReader->term, pReader->pData, nSuffix); | 4729 dataBufferAppend(&pReader->term, pReader->pData, nSuffix); |
4730 | 4730 |
(...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7406 sqlite3 *db, | 7406 sqlite3 *db, |
7407 char **pzErrMsg, | 7407 char **pzErrMsg, |
7408 const sqlite3_api_routines *pApi | 7408 const sqlite3_api_routines *pApi |
7409 ){ | 7409 ){ |
7410 SQLITE_EXTENSION_INIT2(pApi) | 7410 SQLITE_EXTENSION_INIT2(pApi) |
7411 return sqlite3Fts3Init(db); | 7411 return sqlite3Fts3Init(db); |
7412 } | 7412 } |
7413 #endif | 7413 #endif |
7414 | 7414 |
7415 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ | 7415 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
OLD | NEW |