• Stephan Bergmann's avatar
    Avoid uncontrolled overflow in SwTable::GetBoxNum · 18b5a001
    Stephan Bergmann yazdı
    ...where bad input like "WRONG CELL NAME" (in PythonTest_sw_python's
    sw/qa/python/check_xtexttable.py) could wrap around to a valid but wrong nRet.
    Instead, return SAL_MAX_UINT16 upon overflow.  At least the call to GetBoxNum in
    SwTable::GetTableBox (sw/source/core/table/swtable.cxx) with bFirstPart
    potentially true, assigning to nBox, then later checks
    
      if( nBox >= pBoxes->size() )
          return nullptr;
    
    so returning SAL_MAX_UINT16 upon overflow appears to be the best choice.
    
    (Found with Clang's -fsanitize=implicit-signed-integer-truncation.)
    
    Change-Id: I12822a6bd4f0269adb14c04eefbd1cde4d288728
    Reviewed-on: https://gerrit.libreoffice.org/68203
    Tested-by: Jenkins
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
    18b5a001
Adı
Son kayıt (commit)
Son güncelleme
..
swnewtable.cxx Loading commit data...
swtable.cxx Loading commit data...