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

Enhance sqlite3_bind_parameter_index so that is does not segfault if

you call it incorrectly by passing NULL in place of the parameter name.
Ticket #1032. (CVS 2159)

FossilOrigin-Name: bf81aabff1303b66f12d28b730d19b7cbdb2de6a
This commit is contained in:
drh
2004-12-09 18:29:13 +00:00
parent 2530378003
commit 10fb11da9e
3 changed files with 8 additions and 8 deletions

View File

@@ -593,7 +593,7 @@ int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
createVarMap(p);
for(i=0; i<p->nVar; i++){
const char *z = p->azVar[i];
if( z && strcmp(z,zName)==0 ){
if( z && zName && strcmp(z,zName)==0 ){
return i+1;
}
}