diff options
author | drh <drh@noemail.net> | 2013-03-01 01:07:17 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-03-01 01:07:17 +0000 |
commit | 503a686e09ce03995eef5d9a95ef217532575be5 (patch) | |
tree | 11602fc697bab83aa85d31324c8abb24189560c8 /src/build.c | |
parent | 016fff2b6eacbf1335e105f430bcd741d771d7f4 (diff) | |
download | sqlite-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/build.c')
-rw-r--r-- | src/build.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/build.c b/src/build.c index 4ce65a43d..5d063f072 100644 --- a/src/build.c +++ b/src/build.c @@ -2594,7 +2594,7 @@ Index *sqlite3CreateIndex( assert( pTab!=0 ); assert( pParse->nErr==0 ); if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 - && memcmp(&pTab->zName[7],"altertab_",9)!=0 ){ + && sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName); goto exit_create_index; } |