aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-03-01 01:07:17 +0000
committerdrh <drh@noemail.net>2013-03-01 01:07:17 +0000
commit503a686e09ce03995eef5d9a95ef217532575be5 (patch)
tree11602fc697bab83aa85d31324c8abb24189560c8 /src/vdbeapi.c
parent016fff2b6eacbf1335e105f430bcd741d771d7f4 (diff)
downloadsqlite-503a686e09ce03995eef5d9a95ef217532575be5.tar.gz
sqlite-503a686e09ce03995eef5d9a95ef217532575be5.zip
Always use strncmp() rather than memcmp() when comparing strings where one
or other string might be less than the length parameter, since optimized versions of memcmp() might read past the first difference and in so doing generate an access violation. FossilOrigin-Name: d73435587ba7459e2e2c32980d0e17abdeceb4bc
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index b48826680..ae3ce2390 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -1198,7 +1198,7 @@ int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
if( zName ){
for(i=0; i<p->nzVar; i++){
const char *z = p->azVar[i];
- if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){
+ if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){
return i+1;
}
}