summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 20:37:56 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 20:37:56 +0000
commita6fbcd2eeb0375622dfe20eb45f70fdf9eff43bc (patch)
tree1258fe70e6e319337de3d3461357fb6a0415ba3d /chrome/common
parenta25097e91f9a65ceecf729fe630880be3cddf05b (diff)
downloadchromium_src-a6fbcd2eeb0375622dfe20eb45f70fdf9eff43bc.zip
chromium_src-a6fbcd2eeb0375622dfe20eb45f70fdf9eff43bc.tar.gz
chromium_src-a6fbcd2eeb0375622dfe20eb45f70fdf9eff43bc.tar.bz2
Don't crash when getting strings out of the database. column_text is a little dangerous because it can return NULL. Most STL string stuff can't handle this. I changed the uses to column_string() which handles NULL properly and generates STL strings for us.
BUG=3770 Review URL: http://codereview.chromium.org/9189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/sqlite_utils.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/common/sqlite_utils.cc b/chrome/common/sqlite_utils.cc
index 38514c0..d881a49 100644
--- a/chrome/common/sqlite_utils.cc
+++ b/chrome/common/sqlite_utils.cc
@@ -50,9 +50,9 @@ bool DoesSqliteColumnExist(sqlite3* db,
return false;
while (s.step() == SQLITE_ROW) {
- if (!strcmp(column_name, s.column_text(1))) {
+ if (!s.column_string(1).compare(column_name)) {
if (column_type && column_type[0])
- return !strcmp(column_type, s.column_text(2));
+ return !s.column_string(2).compare(column_type);
return true;
}
}