From 5cdf25e444f99517f54ac66f039e550e3c23c50d Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Mon, 13 May 2013 19:30:28 +0000 Subject: Convert degenerate memcmp() to strncmp() in SQLite TimeMachine patch. BUG=178677 Review URL: https://chromiumcodereview.appspot.com/14651031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199794 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/sqlite/amalgamation/sqlite3.c | 2 +- third_party/sqlite/mac_time_machine.patch | 2 +- third_party/sqlite/src/src/pager.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'third_party') diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c index 247d842..c51a376 100644 --- a/third_party/sqlite/amalgamation/sqlite3.c +++ b/third_party/sqlite/amalgamation/sqlite3.c @@ -41637,7 +41637,7 @@ static int pager_open_journal(Pager *pPager){ ** implementations. */ if( rc==SQLITE_OK && pPager->zFilename!=NULL && strlen(pPager->zFilename)>0 - && memcmp(pVfs->zName, "unix", 4)==0 + && strncmp(pVfs->zName, "unix", 4)==0 && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){ CFURLRef database = create_cfurl_from_cstring(pPager->zFilename); if( CSBackupIsItemExcluded(database, NULL) ){ diff --git a/third_party/sqlite/mac_time_machine.patch b/third_party/sqlite/mac_time_machine.patch index 905609e..bfd113b 100644 --- a/third_party/sqlite/mac_time_machine.patch +++ b/third_party/sqlite/mac_time_machine.patch @@ -55,7 +55,7 @@ Index: src/pager.c + ** implementations. */ + if( rc==SQLITE_OK && pPager->zFilename!=NULL + && strlen(pPager->zFilename)>0 -+ && memcmp(pVfs->zName, "unix", 4)==0 ++ && strncmp(pVfs->zName, "unix", 4)==0 + && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){ + CFURLRef database = create_cfurl_from_cstring(pPager->zFilename); + if( CSBackupIsItemExcluded(database, NULL) ){ diff --git a/third_party/sqlite/src/src/pager.c b/third_party/sqlite/src/src/pager.c index 8cd31a9..19059c8 100644 --- a/third_party/sqlite/src/src/pager.c +++ b/third_party/sqlite/src/src/pager.c @@ -5209,7 +5209,7 @@ static int pager_open_journal(Pager *pPager){ ** implementations. */ if( rc==SQLITE_OK && pPager->zFilename!=NULL && strlen(pPager->zFilename)>0 - && memcmp(pVfs->zName, "unix", 4)==0 + && strncmp(pVfs->zName, "unix", 4)==0 && ( pVfs->zName[4]=='-' || pVfs->zName[4]=='\0' ) ){ CFURLRef database = create_cfurl_from_cstring(pPager->zFilename); if( CSBackupIsItemExcluded(database, NULL) ){ -- cgit v1.1