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

Issue 9418021: Clear statement before closing db in cookie code. (Closed)

Created:
8 years, 10 months ago by Scott Hess - ex-Googler
Modified:
8 years, 10 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, erikwright (departed), wtc, Randy Smith (Not in Mondays), darin-cc_chromium.org, rkn, Greg Billock
Visibility:
Public.

Description

Clear statement before closing db in cookie code. sql::Statement maintains a weak ref to the associated sql::Connection, meaning that if the database and statement are destructed in the wrong order, a use-after-free can result. sql::Statement::Clear() allows resetting the statement to the default-constructed state. BUG=111376 TEST=fewer crashes. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=122430

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -2 lines) Patch
M chrome/browser/net/sqlite_persistent_cookie_store.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M sql/statement.h View 1 chunk +4 lines, -0 lines 0 comments Download
M sql/statement.cc View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Scott Hess - ex-Googler
I tested this by manually breaking the database format, converting some DCHECK-type cases to logging, ...
8 years, 10 months ago (2012-02-16 21:34:04 UTC) #1
Scott Hess - ex-Googler
Adding Greg so he can track it WRT his change-which-will-need-a-merge.
8 years, 10 months ago (2012-02-16 21:52:14 UTC) #2
Scott Hess - ex-Googler
Eric, Erik gave a broad OK to this approach at: https://chromiumcodereview.appspot.com/9418021/ I IM'ed him w/o ...
8 years, 10 months ago (2012-02-16 23:07:57 UTC) #3
erikwright (departed)
LGTM. Thanks Scott!
8 years, 10 months ago (2012-02-17 00:22:26 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shess@chromium.org/9418021/1
8 years, 10 months ago (2012-02-17 00:28:29 UTC) #5
commit-bot: I haz the power
8 years, 10 months ago (2012-02-17 02:15:10 UTC) #6
Change committed as 122430

Powered by Google App Engine
This is Rietveld 408576698