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/analyze.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/analyze.c')
-rw-r--r-- | src/analyze.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/analyze.c b/src/analyze.c index 632fdc1ac..9a3e9597d 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -473,7 +473,7 @@ static void analyzeOneTable( /* Do not gather statistics on views or virtual tables */ return; } - if( memcmp(pTab->zName, "sqlite_", 7)==0 ){ + if( sqlite3_strnicmp(pTab->zName, "sqlite_", 7)==0 ){ /* Do not gather statistics on system tables */ return; } @@ -883,7 +883,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ if( pIndex==0 ) break; pIndex->aiRowEst[i] = v; if( *z==' ' ) z++; - if( memcmp(z, "unordered", 10)==0 ){ + if( strcmp(z, "unordered")==0 ){ pIndex->bUnordered = 1; break; } |