mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Add new defenses against misuse of the C API. Ticket #870. (CVS 1906)
FossilOrigin-Name: 6ef1f662d71c75bdb7f61b2fff03f5b1b41e5586
This commit is contained in:
19
src/main.c
19
src/main.c
@@ -14,7 +14,7 @@
|
||||
** other files are for internal use by SQLite and should not be
|
||||
** accessed by users of the library.
|
||||
**
|
||||
** $Id: main.c,v 1.253 2004/08/21 17:54:45 drh Exp $
|
||||
** $Id: main.c,v 1.254 2004/08/28 14:49:47 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -1240,7 +1240,13 @@ int sqlite3_open16(
|
||||
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
|
||||
*/
|
||||
int sqlite3_finalize(sqlite3_stmt *pStmt){
|
||||
return pStmt ? sqlite3VdbeFinalize((Vdbe*)pStmt) : SQLITE_OK;
|
||||
int rc;
|
||||
if( pStmt==0 ){
|
||||
rc = SQLITE_OK;
|
||||
}else{
|
||||
rc = sqlite3VdbeFinalize((Vdbe*)pStmt);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1252,8 +1258,13 @@ int sqlite3_finalize(sqlite3_stmt *pStmt){
|
||||
** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
|
||||
*/
|
||||
int sqlite3_reset(sqlite3_stmt *pStmt){
|
||||
int rc = sqlite3VdbeReset((Vdbe*)pStmt);
|
||||
sqlite3VdbeMakeReady((Vdbe*)pStmt, -1, 0, 0, 0);
|
||||
int rc;
|
||||
if( pStmt==0 ){
|
||||
rc = SQLITE_OK;
|
||||
}else{
|
||||
rc = sqlite3VdbeReset((Vdbe*)pStmt);
|
||||
sqlite3VdbeMakeReady((Vdbe*)pStmt, -1, 0, 0, 0);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user