Issue 127451

Summary: Possible access to unintended variable in "main/sw/source/core/txtnode/txtedt.cxx" line 1815
Product: Writer Reporter: Petru-Florin Mihancea <petrum>
Component: codeAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P5 (lowest) CC: petrum
Version: 4.2.0-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Petru-Florin Mihancea 2017-06-23 07:53:45 UTC
While experimenting with a CodeSonar plugin we develop, we noticed a
potential issue in file "main/sw/source/core/txtnode/txtedt.cxx" line 1815 function TransliterateText

Sequence <sal_Int32> aOffsets;
                String sChgd( rTrans.transliterate( GetTxt(), 
                        GetLang( nCurrentStart ), nCurrentStart, nLen, &aOffsets ));

                if (!m_Text.Equals( sChgd, nStt, nLen )) //Line 1815
                    aChgData.nStart     = nCurrentStart;
                    aChgData.nLen       = nLen;
                    aChgData.sChanged   = sChgd;
                    aChgData.aOffsets   = aOffsets;
                    aChanges.push_back( aChgData );

In line 1815 it might be possible that nCurrentStart must be used instead of nStt. 

Petru-Florin Mihancea