Commit 76eb95be authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

[printing] Handle large page counts in PrintJobWorker::GetSettingsWithUI

This CL checks the case that |document_page_count| is bigger than
|kMaxPageCount| at PrintJobWorker::GetSettingsWithUI() to fix the
fuzzer issue from the ipc_fuzzer_replay and the ipcdump.

On the normal flow, the renderer doesn't call
GetPrintSettingsFromUser() if |expected_page_count| is bigger
than |kMaxPageCount| at PrintRenderFrameHelper::Print().

Bug: 1130456
Change-Id: Ic1c91399eba2c794240744320b8d8a3ce5eaeb85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421849
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809236}
parent 09aa5258
......@@ -269,7 +269,11 @@ void PrintJobWorker::GetSettingsWithUI(uint32_t document_page_count,
bool is_scripted,
SettingsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_LE(document_page_count, kMaxPageCount);
if (document_page_count > kMaxPageCount) {
GetSettingsDone(std::move(callback), PrintingContext::Result::FAILED);
return;
}
content::WebContents* web_contents = GetWebContents();
......
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