From 81f9eeef041f2974274751d7508598049ae32db2 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 5 Sep 2017 15:33:18 -0400 Subject: Convert FX_STRSIZE int->size_t Change the underlying type for FX_STRSIZE to size_t from int. This will make the value unsigned and thus all values in the range of the type will be valid. This allows for the final remove of negative length strings, but also introduces a some casting and functional errors, since many parts of the code base assume that FX_STRSIZE is int or another signed type. This also CL fixes these errors. BUG=pdfium:828 Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b Reviewed-on: https://pdfium-review.googlesource.com/11830 Reviewed-by: Henrique Nakashima Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- fxbarcode/datamatrix/BC_ErrorCorrection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fxbarcode/datamatrix/BC_ErrorCorrection.cpp') diff --git a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index 2e84df5c59..c45eadcf9a 100644 --- a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -122,7 +122,8 @@ CBC_ErrorCorrection::~CBC_ErrorCorrection() {} CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t& e) { - if (codewords.GetLength() != symbolInfo->dataCapacity()) { + if (pdfium::base::checked_cast(codewords.GetLength()) != + symbolInfo->dataCapacity()) { e = BCExceptionIllegalArgument; return CFX_WideString(); } -- cgit v1.2.3