From 232b918d1f0faec230652f4097b834257a7dbb27 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 3 Apr 2018 16:32:19 +0000 Subject: 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 Commit-Queue: Tom Sepez --- core/fpdfapi/parser/cpdf_crypto_handler.cpp | 2 +- core/fpdfapi/parser/cpdf_crypto_handler.h | 2 +- core/fpdfapi/parser/cpdf_security_handler.h | 4 ++-- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 3 +-- core/fpdfapi/parser/cpdf_syntax_parser.h | 6 +++--- 5 files changed, 8 insertions(+), 9 deletions(-) (limited to 'core/fpdfapi/parser') 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 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 m_pEncryptDict; ByteString m_FileId; uint32_t m_Permissions; int m_Cipher; - uint8_t m_EncryptKey[32]; int m_KeyLen; bool m_bOwnerUnlocked; + UnownedPtr m_pEncryptDict; std::unique_ptr 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()) {} +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 m_pFileAccess; FX_FILESIZE m_HeaderOffset; FX_FILESIZE m_FileLen; + WeakPtr m_pPool; std::vector m_pFileBuf; + RetainPtr m_pFileAccess; FX_FILESIZE m_BufOffset; - uint8_t m_WordBuffer[257]; uint32_t m_WordSize; - WeakPtr m_pPool; + uint8_t m_WordBuffer[257]; }; #endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ -- cgit v1.2.3