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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 599373003: Memory allocation for WriteInto is not proper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 42f69e7bf2a9bb30154015f0bd2269ff6f0a908b..7b0726ac0bd2831884302e51284bc27d01b46489 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -3400,8 +3400,8 @@ bool PDFiumEngineExports::RenderPDFPageToDC(const void* pdf_buffer,
base::string16 creator;
size_t buffer_bytes = FPDF_GetMetaText(doc, "Creator", NULL, 0);
if (buffer_bytes > 1) {
- FPDF_GetMetaText(doc, "Creator", WriteInto(&creator, buffer_bytes),
- buffer_bytes);
+ FPDF_GetMetaText(
+ doc, "Creator", WriteInto(&creator, buffer_bytes + 1), buffer_bytes);
}
bool use_bitmap = false;
if (StartsWith(creator, L"cairo", false))
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698