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

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: Add WStringLength function 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
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | fpdfsdk/src/fpdftext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfdoc.cpp
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index edd61f9e516431cd6faa39fc220c11c4c000365a..e974ffbcf245a561c39f7a6d9305139a4e9edfdc 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -36,7 +36,8 @@ 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 = CFX_WideString::WStringLength(title);
+ CFX_WideString wstr = CFX_WideString::FromUTF16LE(title, len);
return FindBookmark(tree, NULL, wstr);
}
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | fpdfsdk/src/fpdftext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698