Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Side by Side Diff: sql/statement.cc

Issue 11886065: Fixing null pointer dereference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sql/connection.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sql/statement.h" 5 #include "sql/statement.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "third_party/sqlite/sqlite3.h" 10 #include "third_party/sqlite/sqlite3.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // TODO(gbillock,shess): make this invalidate the statement so it 299 // TODO(gbillock,shess): make this invalidate the statement so it
300 // can't wreak havoc. 300 // can't wreak havoc.
301 if (err == SQLITE_RANGE) 301 if (err == SQLITE_RANGE)
302 DLOG(FATAL) << "Bind value out of range"; 302 DLOG(FATAL) << "Bind value out of range";
303 return err == SQLITE_OK; 303 return err == SQLITE_OK;
304 } 304 }
305 305
306 int Statement::CheckError(int err) { 306 int Statement::CheckError(int err) {
307 // Please don't add DCHECKs here, OnSqliteError() already has them. 307 // Please don't add DCHECKs here, OnSqliteError() already has them.
308 succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); 308 succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE);
309 if (!succeeded_ && is_valid()) 309 if (!succeeded_ && is_valid() && ref_->connection())
310 return ref_->connection()->OnSqliteError(err, this); 310 return ref_->connection()->OnSqliteError(err, this);
311 return err; 311 return err;
312 } 312 }
313 313
314 } // namespace sql 314 } // namespace sql
OLDNEW
« no previous file with comments | « sql/connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698