summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfdoc.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-07-14 12:13:53 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-07-14 12:13:53 -0700
commit8daab317ff959905e926b861a7d2aa876fd10429 (patch)
treed42dbefe9bbdf4492c537253fbc23abf21585fb5 /fpdfsdk/src/fpdfdoc.cpp
parent456cde93a928629bbf2ac64bda13ef7923359823 (diff)
downloadpdfium-8daab317ff959905e926b861a7d2aa876fd10429.tar.xz
Fix an out-of-boundary issue for wide string
BUG=381521 R=palmer@chromium.org Review URL: https://codereview.chromium.org/383563002
Diffstat (limited to 'fpdfsdk/src/fpdfdoc.cpp')
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index edd61f9e51..e974ffbcf2 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);
}