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

Unified Diff: fpdfsdk/src/fpdfdoc.cpp

Issue 383563002: Fix an out-of-boundary issue for wide string (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Tabify files Created 6 years, 5 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
Index: fpdfsdk/src/fpdfdoc.cpp
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index edd61f9e516431cd6faa39fc220c11c4c000365a..e210533d07dccb051853d9ffab76f9a8de5d63ba 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -36,7 +36,9 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_W
CPDF_Document* pDoc = (CPDF_Document*)document;
CPDF_BookmarkTree tree(pDoc);
- CFX_WideString wstr = CFX_WideString::FromUTF16LE(title);
+ FX_STRSIZE len = 0;
+ while (title[len]) len++;
palmer 2014/07/12 00:54:39 wcslen?
Bo Xu 2014/07/12 05:18:04 Done.
+ CFX_WideString wstr = CFX_WideString::FromUTF16LE(title, len);
return FindBookmark(tree, NULL, wstr);
}

Powered by Google App Engine
This is Rietveld 408576698