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

Unified Diff: printing/printing_context_win.cc

Issue 3454022: Fix a c_str() use-after-free bug in the printing code. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context_win.cc
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index a94c71fffac7568cdf355f24562b9bd275ee5df3..d0d7a1cfb7baa79eee71357be7216b0da8e9e67c 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -262,7 +262,8 @@ PrintingContext::Result PrintingContext::NewDocument(
return OnError();
DOCINFO di = { sizeof(DOCINFO) };
- di.lpszDocName = UTF16ToWide(document_name).c_str();
+ const std::wstring& document_name_wide = UTF16ToWide(document_name);
+ di.lpszDocName = document_name_wide.c_str();
// Is there a debug dump directory specified? If so, force to print to a file.
FilePath debug_dump_path = PrintedDocument::debug_dump_path();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698