summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-07 22:48:08 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-07 22:48:08 +0000
commitbdf12cb7099bc6adf9ae17dd30cd8f29498d3cb5 (patch)
tree0699935aa812f732db69856ffef51dfade9ee402
parent4d3cc0101211d30d74f37c9ecfc8526402a3bd2f (diff)
downloadchromium_src-bdf12cb7099bc6adf9ae17dd30cd8f29498d3cb5.zip
chromium_src-bdf12cb7099bc6adf9ae17dd30cd8f29498d3cb5.tar.gz
chromium_src-bdf12cb7099bc6adf9ae17dd30cd8f29498d3cb5.tar.bz2
Linux: Fix a NULL deref in printing code that is only reachable with messages from a bad renderer.
BUG=341777 Review URL: https://codereview.chromium.org/157323002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249831 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--printing/printing_context_linux.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/printing/printing_context_linux.cc b/printing/printing_context_linux.cc
index 98ed2e7..3b6d2ee 100644
--- a/printing/printing_context_linux.cc
+++ b/printing/printing_context_linux.cc
@@ -71,6 +71,14 @@ void PrintingContextLinux::AskUserForSettings(
int max_pages,
bool has_selection,
const PrintSettingsCallback& callback) {
+ if (!print_dialog_) {
+ // Can only get here if the renderer is sending bad messages.
+ // http://crbug.com/341777
+ NOTREACHED();
+ callback.Run(FAILED);
+ return;
+ }
+
print_dialog_->ShowDialog(parent_view, has_selection, callback);
}