Issue 127451 - Possible access to unintended variable in "main/sw/source/core/txtnode/txtedt.cxx" line 1815
Summary: Possible access to unintended variable in "main/sw/source/core/txtnode/txtedt...
Status: UNCONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: 4.2.0-dev
Hardware: All All
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 07:53 UTC by Petru-Florin Mihancea
Modified: 2018-09-17 14:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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. 

Thanks,
Petru-Florin Mihancea