DelphinSoftware / vcl-styles-utils

Automatically exported from code.google.com/p/vcl-styles-utils
0 stars 0 forks source link

Integer overflow in vcl.styles.hooks #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Vcl.Styles.Hooks Line 105:

LBrush.Color:= StyleServices.GetSystemColor(TColor(nIndex or 
Integer($FF000000)));

should use typecast:

LBrush.Color:= DWORD(StyleServices.GetSystemColor(TColor(nIndex or 
Integer($FF000000))));

Original issue reported on code.google.com by everyb...@gmail.com on 25 Nov 2014 at 7:56

GoogleCodeExporter commented 9 years ago
Absolutely not.You shouldn't do typecasting .
TColor is signed and DWORD is'not !
And ,in the other hand StyleServices.GetSystemColor return TColor type.

Original comment by ismspi...@gmail.com on 29 Nov 2014 at 2:03

GoogleCodeExporter commented 9 years ago
Hi Everbyte, can you please attach a sample project to reproduce the Integer 
overflow?

Also the comment of ismspider is right, you don't need type cast to DWORD 
because the StyleServices.GetSystemColor method returns a TColor which is the 
same type of the TBrush.Color property.

Regards
Rodrigo.

Original comment by Rodrigo.Ruz.V@gmail.com on 4 Dec 2014 at 3:02

GoogleCodeExporter commented 9 years ago
Integer overflow is no longer happening. Case can be closed

Original comment by everyb...@gmail.com on 3 Feb 2015 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by Rodrigo.Ruz.V@gmail.com on 3 Feb 2015 at 2:38