Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found
with Coverity Scan.
1 new defect(s) introduced to LibreOffice found with Coverity Scan.
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent
build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 1669071: Integer handling issues (INTEGER_OVERFLOW)
/sw/source/uibase/utlui/prcntfld.cxx: 82 in
SwPercentField::ShowPercent(bool, unsigned short)()
_____________________________________________________________________________________________
*** CID 1669071: Integer handling issues (INTEGER_OVERFLOW)
/sw/source/uibase/utlui/prcntfld.cxx: 82 in
SwPercentField::ShowPercent(bool, unsigned short)()
76
77 sal_Int64 nCurrentWidth
78 = vcl::ConvertValue(m_nOldMin, 0, m_nOldDigits, m_eOldUnit,
FieldUnit::TWIP);
79 nCurrentWidth = UpscaleTwoDecimalPlaces(nCurrentWidth,
m_nOldDigits);
80
81 // round to 0.5 percent
>>> CID 1669071: Integer handling issues (INTEGER_OVERFLOW)
>>> Expression "nCurrentWidth * 10L", where "nCurrentWidth" is known to be
>>> equal to -9223372036854775808, overflows the type of "nCurrentWidth * 10L",
>>> which is type "long".
82 int nPercent = m_nRefValue ? (((nCurrentWidth * 10) /
m_nRefValue + 5) / 10) : 0;
83
84 m_pField->set_range(std::max(1, nPercent), nMaxPercent,
FieldUnit::NONE);
85 m_pField->set_increments(5, 10, FieldUnit::NONE);
86 if (nOldValue != m_nLastValue)
87 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://scan.coverity.com/projects/libreoffice?tab=overview