SQLite

Check-in [1cceefa7c6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the printf, strftime, and glob modes of fuzzershell so that they reject all inputs that do not start with a string literal followed by a comma. This helps the fuzzer focus in on the kinds of behavior those modes are intended to test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1cceefa7c6585bca786fe9f7118f7beb829ad709
User & Date: drh 2015-04-22 11:16:34.611
Context
2015-04-22
13:16
Improved filtering of input for fuzzershell for modes other than generic. (check-in: 025e8370dd user: drh tags: trunk)
11:16
Change the printf, strftime, and glob modes of fuzzershell so that they reject all inputs that do not start with a string literal followed by a comma. This helps the fuzzer focus in on the kinds of behavior those modes are intended to test. (check-in: 1cceefa7c6 user: drh tags: trunk)
01:33
When compiling for UAP, link against the new minimal MSVC runtime. (check-in: 2cb945116e user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to tool/fuzzershell.c.
481
482
483
484
485
486
487





488
489
490
491
492
493
494
495
      if( z ){
        z += 6;
        printf("%.*s\n", (int)(z-&zIn[i]), &zIn[i]);
        i += (int)(z-&zIn[i]);
      }
    }
    for(iNext=i; iNext<nIn && strncmp(&zIn[iNext],"/****<",6)!=0; iNext++){}





    
    rc = sqlite3_open_v2(
      "main.db", &db,
      SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY,
      0);
    if( rc!=SQLITE_OK ){
      abendError("Unable to open the in-memory database");
    }







>
>
>
>
>
|







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
      if( z ){
        z += 6;
        printf("%.*s\n", (int)(z-&zIn[i]), &zIn[i]);
        i += (int)(z-&zIn[i]);
      }
    }
    for(iNext=i; iNext<nIn && strncmp(&zIn[iNext],"/****<",6)!=0; iNext++){}
    cSaved = zIn[iNext];
    zIn[iNext] = 0;
    if( iMode!=FZMODE_Generic && sqlite3_strglob("'*',*",&zIn[i])!=0 ){
      zIn[iNext] = cSaved;
      continue;
    }
    rc = sqlite3_open_v2(
      "main.db", &db,
      SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY,
      0);
    if( rc!=SQLITE_OK ){
      abendError("Unable to open the in-memory database");
    }
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
    sqlite3_trace(db, traceCallback, 0);
    sqlite3_create_function(db, "eval", 1, SQLITE_UTF8, 0, sqlEvalFunc, 0, 0);
    sqlite3_create_function(db, "eval", 2, SQLITE_UTF8, 0, sqlEvalFunc, 0, 0);
    sqlite3_limit(db, SQLITE_LIMIT_LENGTH, 1000000);
    if( zEncoding ) sqlexec(db, "PRAGMA encoding=%s", zEncoding);
    if( pageSize ) sqlexec(db, "PRAGMA pagesize=%d", pageSize);
    if( doAutovac ) sqlexec(db, "PRAGMA auto_vacuum=FULL");
    cSaved = zIn[iNext];
    zIn[iNext] = 0;
    printf("INPUT (offset: %d, size: %d): [%s]\n",
            i, (int)strlen(&zIn[i]), &zIn[i]);
    zSql = &zIn[i];
    switch( iMode ){
      case FZMODE_Glob:
        zSql = zToFree = sqlite3_mprintf("SELECT glob(%s);", zSql);
        break;







<
<







515
516
517
518
519
520
521


522
523
524
525
526
527
528
    sqlite3_trace(db, traceCallback, 0);
    sqlite3_create_function(db, "eval", 1, SQLITE_UTF8, 0, sqlEvalFunc, 0, 0);
    sqlite3_create_function(db, "eval", 2, SQLITE_UTF8, 0, sqlEvalFunc, 0, 0);
    sqlite3_limit(db, SQLITE_LIMIT_LENGTH, 1000000);
    if( zEncoding ) sqlexec(db, "PRAGMA encoding=%s", zEncoding);
    if( pageSize ) sqlexec(db, "PRAGMA pagesize=%d", pageSize);
    if( doAutovac ) sqlexec(db, "PRAGMA auto_vacuum=FULL");


    printf("INPUT (offset: %d, size: %d): [%s]\n",
            i, (int)strlen(&zIn[i]), &zIn[i]);
    zSql = &zIn[i];
    switch( iMode ){
      case FZMODE_Glob:
        zSql = zToFree = sqlite3_mprintf("SELECT glob(%s);", zSql);
        break;