Issue 127450 - Possible access to unintended variable in "main/vcl/source/window/winproc.cxx" line 2330
Summary: Possible access to unintended variable in "main/vcl/source/window/winproc.cxx...
Status: UNCONFIRMED
Alias: None
Product: General
Classification: Code
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-22 13:44 UTC by Petru-Florin Mihancea
Modified: 2017-06-22 13:44 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-22 13:44:15 UTC
While experimenting with a CodeSonar plugin we develop, we noticed a
potential issue in file "main/vcl/source/window/winproc.cxx" line 2330 function 
ImplHandleSalSurroundingTextRequest


if( aSelRange.Max() < 0 )
	pEvt->mnStart = 0; //Line 2330
else if( aSelRange.Max() > pEvt->maText.Len() )
	pEvt->mnEnd = pEvt->maText.Len();
else
        pEvt->mnEnd = aSelRange.Max();

Shouldn't pEvt->mnEnd be initialied with 0? (instead of pEvt->mnStart).

Thanks,
Petru-Florin Mihancea