summaryrefslogtreecommitdiffstats
path: root/printing/printing_context_win.cc
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 00:34:47 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 00:34:47 +0000
commitea6f72a97cc771f6d4ecd3f32fbba8e678a0127f (patch)
treea48dd234160485a3d06a74e67cffe1272eaf9128 /printing/printing_context_win.cc
parente8c5081971797d743bce0d9433201601b568a08b (diff)
downloadchromium_src-ea6f72a97cc771f6d4ecd3f32fbba8e678a0127f.zip
chromium_src-ea6f72a97cc771f6d4ecd3f32fbba8e678a0127f.tar.gz
chromium_src-ea6f72a97cc771f6d4ecd3f32fbba8e678a0127f.tar.bz2
Fix a c_str() use-after-free bug in the printing code.
BUG= TEST= Review URL: http://codereview.chromium.org/3454022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/printing_context_win.cc')
-rw-r--r--printing/printing_context_win.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index 3268537..038f5d3 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -255,7 +255,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();