View Issue Details

IDProjectCategoryView StatusLast Update
0035637LazarusFCLpublic2019-05-27 15:02
ReporterPascal Riekenberg Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 10 x64 
Product Version2.0.3 (SVN) 
Summary0035637: Wrong variable type in GetControlText. Return of -1 leads to error.
DescriptionWrong variable type in GetControlText.
If
  TextLen := Windows.GetWindowTextLengthW(AHandle);
returns -1
  SetLength(WideBuffer, TextLen);
probably leads to out of memory
TagsNo tags attached.
Fixed in Revisionr61295
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Pascal Riekenberg

2019-05-27 09:00

developer  

win32proc.pp.patch (427 bytes)   
Index: lcl/interfaces/win32/win32proc.pp
===================================================================
--- lcl/interfaces/win32/win32proc.pp	(revision 61293)
+++ lcl/interfaces/win32/win32proc.pp	(working copy)
@@ -1065,7 +1065,7 @@
 
 function GetControlText(AHandle: HWND): string;
 var
-  TextLen: dword;
+  TextLen: longint;
   WideBuffer: WideString;
 begin
   TextLen := Windows.GetWindowTextLengthW(AHandle);
win32proc.pp.patch (427 bytes)   

Juha Manninen

2019-05-27 11:40

developer   ~0116429

Applied, thanks.

Pascal Riekenberg

2019-05-27 15:02

developer   ~0116433

yw

Issue History

Date Modified Username Field Change
2019-05-27 09:00 Pascal Riekenberg New Issue
2019-05-27 09:00 Pascal Riekenberg File Added: win32proc.pp.patch
2019-05-27 11:36 Juha Manninen Assigned To => Juha Manninen
2019-05-27 11:36 Juha Manninen Status new => assigned
2019-05-27 11:40 Juha Manninen Status assigned => resolved
2019-05-27 11:40 Juha Manninen Resolution open => fixed
2019-05-27 11:40 Juha Manninen Fixed in Revision => r61295
2019-05-27 11:40 Juha Manninen LazTarget => -
2019-05-27 11:40 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2019-05-27 11:40 Juha Manninen Note Added: 0116429
2019-05-27 15:02 Pascal Riekenberg Status resolved => closed
2019-05-27 15:02 Pascal Riekenberg Note Added: 0116433