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

Unified Diff: fpdfsdk/fpdfdoc.cpp

Issue 2519343002: Add APIs for limited use of document tagged code. (Closed)
Patch Set: More nits Created 4 years, 1 month 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 | « fpdfsdk/fpdf_structtree_embeddertest.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfdoc.cpp
diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp
index 254be3f883acca4fc25fadd3bb971ec0812fd0c5..2dcf606a7cb79f476df34c7d8477fbc8eeaa39ee 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;
}
« no previous file with comments | « fpdfsdk/fpdf_structtree_embeddertest.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698