1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Test string values passed to bind_text() and result_text() for a nul-terminator. (CVS 4915)

FossilOrigin-Name: 24c3ebc0c5c53c234516d16dce761d713fb29578
This commit is contained in:
danielk1977
2008-03-25 16:16:29 +00:00
parent 52ae7246c6
commit 4e1ddde370
4 changed files with 18 additions and 10 deletions

View File

@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
** $Id: tclsqlite.c,v 1.211 2008/03/19 19:01:22 drh Exp $
** $Id: tclsqlite.c,v 1.212 2008/03/25 16:16:29 danielk1977 Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -1671,7 +1671,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
sqlite3_bind_int64(pStmt, i, v);
}else{
data = (unsigned char *)Tcl_GetStringFromObj(pVar, &n);
sqlite3_bind_text(pStmt, i, (char *)data, n, SQLITE_STATIC);
sqlite3_bind_text(pStmt, i, (char *)data, n+1, SQLITE_STATIC);
Tcl_IncrRefCount(pVar);
apParm[nParm++] = pVar;
}