/ Check-in [f8cf7ff1]
Login

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

Overview
Comment:Take care not to try to generate code for the ATTACH and DETACH commands if there were syntax errors during parsing. Fix for ticket [2f1b168ab4d4844]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.15
Files: files | file ages | folders
SHA1:f8cf7ff1560dbd0dde5e6d4c9c22cd8ff43cce09
User & Date: drh 2016-11-23 19:40:23
Context
2016-11-23
19:43
Handle some obscure "row value misused" cases that could cause segfaults or assertion failures. check-in: 794763fd user: drh tags: branch-3.15
19:40
Take care not to try to generate code for the ATTACH and DETACH commands if there were syntax errors during parsing. Fix for ticket [2f1b168ab4d4844] check-in: f8cf7ff1 user: drh tags: branch-3.15
2016-11-04
12:08
Version 3.15.1 check-in: 1136863c user: drh tags: release, version-3.15.1, branch-3.15
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/attach.c.

321
322
323
324
325
326
327

328
329
330
331
332
333
334
){
  int rc;
  NameContext sName;
  Vdbe *v;
  sqlite3* db = pParse->db;
  int regArgs;


  memset(&sName, 0, sizeof(NameContext));
  sName.pParse = pParse;

  if( 
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))







>







321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
){
  int rc;
  NameContext sName;
  Vdbe *v;
  sqlite3* db = pParse->db;
  int regArgs;

  if( pParse->nErr ) goto attach_end;
  memset(&sName, 0, sizeof(NameContext));
  sName.pParse = pParse;

  if( 
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))

Changes to test/fuzz-oss1.test.

1993
1994
1995
1996
1997
1998
1999




2000
2001
"nao:Property14"."ID" AND "9_u" IS NOT NULL AND "10_u" IS NOT
NULL AND ("9_u" COLLATE NOCASE = ? COLLATE NOCASE))) FROM (SELECT
"nco:PersonContact1"."ID" AS "1_u" FROM "nco:PersonContact" AS
"nco:PersonContact1") ORDER BY "1_u";
  }
} {/.* Goto .*/}






finish_test







>
>
>
>


1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
"nao:Property14"."ID" AND "9_u" IS NOT NULL AND "10_u" IS NOT
NULL AND ("9_u" COLLATE NOCASE = ? COLLATE NOCASE))) FROM (SELECT
"nco:PersonContact1"."ID" AS "1_u" FROM "nco:PersonContact" AS
"nco:PersonContact1") ORDER BY "1_u";
  }
} {/.* Goto .*/}

# Crash reported by OSS-FUZZ on 2016-11-10
do_catchsql_test fuzz-oss1-detach {
  DETACH x IS #1;
} {1 {near "#1": syntax error}}

finish_test