Commit bdd63388 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[NativeFS] Fix clusterfuzz crash in FileSystemChooser.

In content_shell --run-web-tests on linux there is no SelectFileDialog
implementation. Deal with this by aborting the dialog if we failed to
create one.

Bug: 1027908
Change-Id: Ibf4d3f1f91a719945140d88deb89dd3218efda36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314808
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791115}
parent c43fa3e8
...@@ -147,6 +147,14 @@ void FileSystemChooser::CreateAndShow( ...@@ -147,6 +147,14 @@ void FileSystemChooser::CreateAndShow(
listener->dialog_ = ui::SelectFileDialog::Create( listener->dialog_ = ui::SelectFileDialog::Create(
listener, listener,
GetContentClient()->browser()->CreateSelectFilePolicy(web_contents)); GetContentClient()->browser()->CreateSelectFilePolicy(web_contents));
// In content_shell --run-web-tests, there might be no dialog available. In
// that case just abort.
if (!listener->dialog_) {
listener->FileSelectionCanceled(nullptr);
return;
}
// TODO(https://crbug.com/878581): Better/more specific options to pass to // TODO(https://crbug.com/878581): Better/more specific options to pass to
// SelectFile. // SelectFile.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment