diff options
author | thestig <thestig@chromium.org> | 2016-11-23 14:10:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-23 14:10:06 -0800 |
commit | 9067fd683ebf8d6467f8cc5aa7daf5e1f950f846 (patch) | |
tree | c967cfe1c94ca9049896d3c3b54d81594c2e9a9f /fpdfsdk/fpdfdoc.cpp | |
parent | 841a85b19cc10d719505ea2c7e0e49bae843db6e (diff) | |
download | pdfium-9067fd683ebf8d6467f8cc5aa7daf5e1f950f846.tar.xz |
Add APIs for limited use of document tagged code.
BUG=pdfium:568
Review-Url: https://codereview.chromium.org/2519343002
Diffstat (limited to 'fpdfsdk/fpdfdoc.cpp')
-rw-r--r-- | fpdfsdk/fpdfdoc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index 254be3f883..2dcf606a7c 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -64,7 +64,7 @@ unsigned long Utf16EncodeMaybeCopyAndReturnLength(const CFX_WideString& text, unsigned long buflen) { CFX_ByteString encodedText = text.UTF16LE_Encode(); unsigned long len = encodedText.GetLength(); - if (buffer && buflen >= len) + if (buffer && len <= buflen) FXSYS_memcpy(buffer, encodedText.c_str(), len); return len; } @@ -186,7 +186,7 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetFilePath(FPDF_ACTION pDict, CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict))); CFX_ByteString path = action.GetFilePath().UTF8Encode(); unsigned long len = path.GetLength() + 1; - if (buffer && buflen >= len) + if (buffer && len <= buflen) FXSYS_memcpy(buffer, path.c_str(), len); return len; } @@ -203,7 +203,7 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict))); CFX_ByteString path = action.GetURI(pDoc); unsigned long len = path.GetLength() + 1; - if (buffer && buflen >= len) + if (buffer && len <= buflen) FXSYS_memcpy(buffer, path.c_str(), len); return len; } |