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

Unified Diff: fpdfsdk/src/fsdk_baseform.cpp

Issue 1710403002: Use safe arithmentic in CFX_BinaryBuf::ExpandBuf. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: needless uint8_t casts. Created 4 years, 10 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/fxcrt/fx_basic_buffer.cpp ('k') | xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_baseform.cpp
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 00ab6c2ef0185c598ea979395395593864bbc348..f05545a6726fd5ce2686749c569c8214582444e7 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -2461,7 +2461,6 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf,
return FALSE;
CFX_ByteTextBuf fdfEncodedData;
-
for (FX_DWORD i = 0; i < pFields->GetCount(); i++) {
CPDF_Dictionary* pField = pFields->GetDictAt(i);
if (!pField)
@@ -2473,14 +2472,13 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf,
CFX_WideString csWValue = PDF_DecodeText(csBValue);
CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(csWValue);
- fdfEncodedData = fdfEncodedData << name_b.GetBuffer(name_b.GetLength());
+ fdfEncodedData << name_b.GetBuffer(name_b.GetLength());
name_b.ReleaseBuffer();
- fdfEncodedData = fdfEncodedData << "=";
- fdfEncodedData = fdfEncodedData
- << csValue_b.GetBuffer(csValue_b.GetLength());
+ fdfEncodedData << "=";
+ fdfEncodedData << csValue_b.GetBuffer(csValue_b.GetLength());
csValue_b.ReleaseBuffer();
if (i != pFields->GetCount() - 1)
- fdfEncodedData = fdfEncodedData << "&";
+ fdfEncodedData << "&";
}
nBufSize = fdfEncodedData.GetLength();
« no previous file with comments | « core/src/fxcrt/fx_basic_buffer.cpp ('k') | xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698