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

Issue 42209: Merge 11262 - Fixes possible crash in SessionBackend. I believe what's happen... (Closed)

Created:
11 years, 9 months ago by laforge
Modified:
9 years, 7 months ago
Reviewers:
sky
CC:
chromium-reviews_googlegroups.com
Base URL:
svn://chrome-svn.corp.google.com/chrome/branches/169/src/
Visibility:
Public.

Description

Merge 11262 - Fixes possible crash in SessionBackend. I believe what's happening here is we fail to create the file, and so current_session_file_.get() is NULL and we crash. current_session_file_.get() is NULL if OpenAndWriteHeader returns NULL (which is does if the full header isn't written correctly. Here's how I'm changing the code: . The file is now truncated instead of closed/reopened. Hopefully this avoids the possibility of a scanner locking the file and the delete failing. . Added a unit test for coverage of truncation. . The file is opened in exclusive access. There is no reason why a scanner should open this file. . Added null checks. BUG=8476 TEST=none Review URL: http://codereview.chromium.org/39275 TBR=sky@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=11710

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -7 lines) Patch
M chrome/browser/sessions/session_backend.h View 2 chunks +13 lines, -2 lines 0 comments Download
M chrome/browser/sessions/session_backend.cc View 4 chunks +20 lines, -5 lines 0 comments Download
M chrome/browser/sessions/session_backend_unittest.cc View 1 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
laforge
11 years, 9 months ago (2009-03-14 18:05:48 UTC) #1
sky
11 years, 9 months ago (2009-03-16 15:38:08 UTC) #2
You also need r11245, otherwise this isn't going to compile.

Powered by Google App Engine
This is Rietveld 408576698