summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-03 16:32:19 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-03 16:32:19 +0000
commit232b918d1f0faec230652f4097b834257a7dbb27 (patch)
treec13213ab3d70cc147a6ea59b0f090a51beecae8f /core/fpdfapi/parser
parent36d7ad4a24287b562e1d88fcde635e36a167bfe3 (diff)
downloadpdfium-232b918d1f0faec230652f4097b834257a7dbb27.tar.xz
Re-arrange so inline vectors come last in structs.
This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_crypto_handler.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_crypto_handler.h2
-rw-r--r--core/fpdfapi/parser/cpdf_security_handler.h4
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.cpp3
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.h6
5 files changed, 8 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.cpp b/core/fpdfapi/parser/cpdf_crypto_handler.cpp
index d963df4887..c27f9dc9fc 100644
--- a/core/fpdfapi/parser/cpdf_crypto_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_crypto_handler.cpp
@@ -110,9 +110,9 @@ void CPDF_CryptoHandler::CryptBlock(bool bEncrypt,
struct AESCryptContext {
bool m_bIV;
- uint8_t m_Block[16];
uint32_t m_BlockOffset;
CRYPT_aes_context m_Context;
+ uint8_t m_Block[16];
};
void* CPDF_CryptoHandler::CryptStart(uint32_t objnum,
diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.h b/core/fpdfapi/parser/cpdf_crypto_handler.h
index 32eeaef4c9..1ca2130717 100644
--- a/core/fpdfapi/parser/cpdf_crypto_handler.h
+++ b/core/fpdfapi/parser/cpdf_crypto_handler.h
@@ -69,10 +69,10 @@ class CPDF_CryptoHandler {
bool bEncrypt);
bool CryptFinish(void* context, CFX_BinaryBuf& dest_buf, bool bEncrypt);
- uint8_t m_EncryptKey[32];
int m_KeyLen;
int m_Cipher;
std::unique_ptr<CRYPT_aes_context, FxFreeDeleter> m_pAESContext;
+ uint8_t m_EncryptKey[32];
};
#endif // CORE_FPDFAPI_PARSER_CPDF_CRYPTO_HANDLER_H_
diff --git a/core/fpdfapi/parser/cpdf_security_handler.h b/core/fpdfapi/parser/cpdf_security_handler.h
index eb9574386e..177c25f29a 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.h
+++ b/core/fpdfapi/parser/cpdf_security_handler.h
@@ -88,14 +88,14 @@ class CPDF_SecurityHandler {
int m_Version;
int m_Revision;
- UnownedPtr<const CPDF_Dictionary> m_pEncryptDict;
ByteString m_FileId;
uint32_t m_Permissions;
int m_Cipher;
- uint8_t m_EncryptKey[32];
int m_KeyLen;
bool m_bOwnerUnlocked;
+ UnownedPtr<const CPDF_Dictionary> m_pEncryptDict;
std::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler;
+ uint8_t m_EncryptKey[32];
};
#endif // CORE_FPDFAPI_PARSER_CPDF_SECURITY_HANDLER_H_
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index 8b8e59fa96..245617dca1 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -40,8 +40,7 @@ enum class ReadStatus { Normal, Backslash, Octal, FinishOctal, CarriageReturn };
// static
int CPDF_SyntaxParser::s_CurrentRecursionDepth = 0;
-CPDF_SyntaxParser::CPDF_SyntaxParser()
- : m_pFileAccess(nullptr), m_pPool(WeakPtr<ByteStringPool>()) {}
+CPDF_SyntaxParser::CPDF_SyntaxParser() = default;
CPDF_SyntaxParser::~CPDF_SyntaxParser() = default;
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h
index 50c20fc115..5aad2e463c 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.h
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.h
@@ -92,14 +92,14 @@ class CPDF_SyntaxParser {
ParseType parse_type);
FX_FILESIZE m_Pos;
- RetainPtr<CPDF_ReadValidator> m_pFileAccess;
FX_FILESIZE m_HeaderOffset;
FX_FILESIZE m_FileLen;
+ WeakPtr<ByteStringPool> m_pPool;
std::vector<uint8_t> m_pFileBuf;
+ RetainPtr<CPDF_ReadValidator> m_pFileAccess;
FX_FILESIZE m_BufOffset;
- uint8_t m_WordBuffer[257];
uint32_t m_WordSize;
- WeakPtr<ByteStringPool> m_pPool;
+ uint8_t m_WordBuffer[257];
};
#endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_