Hello,

The SQLite library is crashing in icuOpen() function because it is trying to 
check the strlen of a string, which is NULL. I have also put the stack trace.

In this case zInput is NULL. And so it is crashing in this line: nInput = 
strlen(zInput);

Here is the partial function definition of icuOpen().

static int icuOpen(
  sqlite3_tokenizer *pTokenizer,         /* The tokenizer */
  const char *zInput,                    /* Input string */
  int nInput,                            /* Length of zInput in bytes */
  sqlite3_tokenizer_cursor **ppCursor    /* OUT: Tokenization cursor */
){
  IcuTokenizer *p = (IcuTokenizer *)pTokenizer;
  IcuCursor *pCsr;

  const int32_t opt = U_FOLD_CASE_DEFAULT;
  UErrorCode status = U_ZERO_ERROR;
  int nChar;

  UChar32 c;
  int iInput = 0;
  int iOut = 0;

  *ppCursor = 0;

  if( nInput<0 ){
    nInput = strlen(zInput);///Crashes here because zInput is NULL///
  }
  nChar = nInput+1;
.
.
.
.
.
.
.


Stack trace:

#0  strlen (s=0x0)
     at strlen.c:9
#1  0x7979f44c in icuOpen (pTokenizer=<optimized out>, zInput=0x0, nInput=-1,
     ppCursor=0x77dc7084)
     at sqlite3/src/sqlite3.c:131816
#2  0x797ab548 in sqlite3Fts3CacheDeferredDoclists (pCsr=<optimized out>)
     at sqlite3/src/sqlite3.c:126136
#3  fts3EvalTestDeferredAndNear (pCsr=0x7baed400, pRc=<optimized out>)
     at sqlite3/src/sqlite3.c:53892
#4  0x797acfb0 in fts3EvalNext (pCsr=<optimized out>)
     at sqlite3/src/sqlite3.c:119461
#5  fts3NextMethod (pCursor=<optimized out>)
     at sqlite3/src/sqlite3.c:52003
#6  0x797c747c in sqlite3VdbeExec (p=0x7b9d8210)
     at sqlite3/src/sqlite3.c:69467
#7  0x797aa314 in sqlite3Step (p=<optimized out>)
     at sqlite3/src/sqlite3.c:61921
#8  sqlite3_step (pStmt=0x7b9ed598)
    at sqlite3/src/sqlite3.c:61994

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this transmission 
by unintended recipients is not authorized and may be unlawful.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to