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

Unified Diff: chrome/common/sqlite_utils.cc

Issue 2801017: sqlite_utils: don't dereference an empty vector. (Closed)
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/util/user_settings_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/sqlite_utils.cc
diff --git a/chrome/common/sqlite_utils.cc b/chrome/common/sqlite_utils.cc
index 8e108a744639e2da2b462a3632d3a9b5919ac8d9..b99b8f26a678a1b16fdd0567db402f2a1d2b2e7a 100644
--- a/chrome/common/sqlite_utils.cc
+++ b/chrome/common/sqlite_utils.cc
@@ -323,7 +323,7 @@ int SQLStatement::bind_parameter_count() {
int SQLStatement::bind_blob(int index, std::vector<unsigned char>* blob) {
if (blob) {
- const void* value = &(*blob)[0];
+ const void* value = blob->empty() ? NULL : &(*blob)[0];
int len = static_cast<int>(blob->size());
return bind_blob(index, value, len);
} else {
« no previous file with comments | « chrome/browser/sync/util/user_settings_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698