SQLite

Check-in [6ac6e4462a]
Login

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

Overview
Comment:Avoid accessing Vdbe.pc if it is uninitialized. Check Vdbe.magic first.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6ac6e4462a08cb2f3d28e4a23218fc1b110a2148
User & Date: drh 2016-10-01 11:39:53.849
Context
2016-10-01
16:53
Make sure deleting an unused prepared statement does not reference uninitialized fields in the structure. (check-in: 7983eef042 user: drh tags: trunk)
11:39
Avoid accessing Vdbe.pc if it is uninitialized. Check Vdbe.magic first. (check-in: 6ac6e4462a user: drh tags: trunk)
00:37
Avoid unnecessary zeroing of fields in the Vdbe object when it is allocated. (check-in: 1e21bbe836 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeapi.c.
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
}

/*
** Return true if the prepared statement is in need of being reset.
*/
int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
  Vdbe *v = (Vdbe*)pStmt;
  return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
}

/*
** Return a pointer to the next prepared statement after pStmt associated
** with database connection pDb.  If pStmt is NULL, return the first
** prepared statement for the database connection.  Return NULL if there
** are no more.







|







1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
}

/*
** Return true if the prepared statement is in need of being reset.
*/
int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
  Vdbe *v = (Vdbe*)pStmt;
  return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0;
}

/*
** Return a pointer to the next prepared statement after pStmt associated
** with database connection pDb.  If pStmt is NULL, return the first
** prepared statement for the database connection.  Return NULL if there
** are no more.