Author: tkreuzer
Date: Wed Aug 4 00:01:30 2010
New Revision: 48446
URL:
http://svn.reactos.org/svn/reactos?rev=48446&view=rev
Log:
[GDI32]
Fix parameter check in GetTextExtentExPointA/W. Patch by Kamil Hornicek. Fixes bug 5486,
bug 5507 and bug 5511
Modified:
trunk/reactos/dll/win32/gdi32/objects/text.c
trunk/reactos/subsystems/win32/win32k/include/text.h
trunk/reactos/subsystems/win32/win32k/objects/freetype.c
Modified: trunk/reactos/dll/win32/gdi32/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] Wed Aug 4 00:01:30 2010
@@ -192,6 +192,13 @@
LPSIZE lpSize
)
{
+
+ if(nMaxExtent < -1)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
return NtGdiGetTextExtentExW (
hdc, (LPWSTR)lpszStr, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0
);
}
@@ -215,6 +222,12 @@
NTSTATUS Status;
LPWSTR lpszStrW;
BOOL rc = 0;
+
+ if(nMaxExtent < -1)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
Status = HEAP_strdupA2W ( &lpszStrW, lpszStr );
if (!NT_SUCCESS (Status))
Modified: trunk/reactos/subsystems/win32/win32k/include/text.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] Wed Aug 4 00:01:30
2010
@@ -96,7 +96,7 @@
ULONG FASTCALL
ftGdiGetGlyphOutline(PDC,WCHAR,UINT,LPGLYPHMETRICS,ULONG,PVOID,LPMAT2,BOOL);
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI,UINT,OUTLINETEXTMETRICW *);
BOOL FASTCALL ftGdiGetRasterizerCaps(LPRASTERIZER_STATUS);
-BOOL FASTCALL
TextIntGetTextExtentPoint(PDC,PTEXTOBJ,LPCWSTR,int,int,LPINT,LPINT,LPSIZE);
+BOOL FASTCALL
TextIntGetTextExtentPoint(PDC,PTEXTOBJ,LPCWSTR,INT,ULONG,LPINT,LPINT,LPSIZE);
BOOL FASTCALL ftGdiGetTextMetricsW(HDC,PTMW_INTERNAL);
DWORD FASTCALL IntGetFontLanguageInfo(PDC);
INT FASTCALL ftGdiGetTextCharsetInfo(PDC,PFONTSIGNATURE,DWORD);
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Wed Aug 4
00:01:30 2010
@@ -2119,8 +2119,8 @@
TextIntGetTextExtentPoint(PDC dc,
PTEXTOBJ TextObj,
LPCWSTR String,
- int Count,
- int MaxExtent,
+ INT Count,
+ ULONG MaxExtent,
LPINT Fit,
LPINT Dx,
LPSIZE Size)