mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Do not references zSql(-1) if nBytes==0 in sqlite3_prepare().
Ticket #3134. (CVS 5155) FossilOrigin-Name: 2d2c53e5058412a5f484ac2ca5bcef596aed2a7b
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
** interface, and routines that contribute to loading the database schema
|
||||
** from disk.
|
||||
**
|
||||
** $Id: prepare.c,v 1.84 2008/05/22 13:56:17 danielk1977 Exp $
|
||||
** $Id: prepare.c,v 1.85 2008/05/23 14:32:19 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -552,7 +552,7 @@ static int sqlite3Prepare(
|
||||
|
||||
memset(&sParse, 0, sizeof(sParse));
|
||||
sParse.db = db;
|
||||
if( nBytes>=0 && zSql[nBytes-1]!=0 ){
|
||||
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
|
||||
char *zSqlCopy;
|
||||
int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
|
||||
if( nBytes>mxLen ){
|
||||
|
||||
Reference in New Issue
Block a user