Issue 127450

Summary: Possible access to unintended variable in "main/vcl/source/window/winproc.cxx" line 2330
Product: General 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-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