From 05ea7e1ae677d0d5872f7ccbaf28f594ad6d94d9 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 11 Aug 2017 16:24:25 -0400 Subject: Remove potential out of bounds call to GetAt() Since m_pos is passed into GetAt() on the underlying string in getCurrentChar(), the value of it needs to confirmed to be valid after decrementing. Some types were changed to reflect the values being stored. BUG=chromium:752480 Change-Id: Ib6d6f52326defd31785e70a17049a08b64dbe069 Reviewed-on: https://pdfium-review.googlesource.com/10652 Commit-Queue: Ryan Harrison Reviewed-by: Tom Sepez --- fxbarcode/datamatrix/BC_EncoderContext.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fxbarcode/datamatrix/BC_EncoderContext.h') diff --git a/fxbarcode/datamatrix/BC_EncoderContext.h b/fxbarcode/datamatrix/BC_EncoderContext.h index 4931501c45..ef4c38ebab 100644 --- a/fxbarcode/datamatrix/BC_EncoderContext.h +++ b/fxbarcode/datamatrix/BC_EncoderContext.h @@ -25,26 +25,26 @@ class CBC_EncoderContext { wchar_t getCurrent(); void writeCodewords(const CFX_WideString& codewords); void writeCodeword(wchar_t codeword); - int32_t getCodewordCount(); + FX_STRSIZE getCodewordCount(); void signalEncoderChange(int32_t encoding); void resetEncoderSignal(); bool hasMoreCharacters(); - int32_t getRemainingCharacters(); + FX_STRSIZE getRemainingCharacters(); void updateSymbolInfo(int32_t& e); void updateSymbolInfo(int32_t len, int32_t& e); void resetSymbolInfo(); CFX_WideString m_msg; CFX_WideString m_codewords; - int32_t m_pos; + FX_STRSIZE m_pos; int32_t m_newEncoding; CFX_UnownedPtr m_symbolInfo; private: - int32_t getTotalMessageCharCount(); + FX_STRSIZE getTotalMessageCharCount(); bool m_allowRectangular; // Force square when false. - int32_t m_skipAtEnd; + FX_STRSIZE m_skipAtEnd; }; #endif // FXBARCODE_DATAMATRIX_BC_ENCODERCONTEXT_H_ -- cgit v1.2.3