diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-19 14:41:46 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-19 14:41:46 -0800 |
commit | 052a8d963af8bb186b956057763021624332c7a8 (patch) | |
tree | 280c161a4970231eff2496f57aa8445b6c2d5405 /fpdfsdk/src | |
parent | ffc26c26f0ab004fbdb05195e1686d7f33983b06 (diff) | |
download | pdfium-052a8d963af8bb186b956057763021624332c7a8.tar.xz |
Revert "Revert "Use safe arithmentic in CFX_BinaryBuf::ExpandBuf.""
This relands the CL at https://codereview.chromium.org/1710403002
Tests passed locally.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1717603003 .
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r-- | fpdfsdk/src/fsdk_baseform.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index 00ab6c2ef0..f05545a672 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(); |