Author: gschneider
Date: Wed Oct 1 06:48:12 2008
New Revision: 36609
URL:
http://svn.reactos.org/svn/reactos?rev=36609&view=rev
Log:
Check DC for NULL before accessing it, fixes Coverity CID 661.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/text.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Wed Oct 1 06:48:12
2008
@@ -3356,13 +3356,13 @@
DWORD cscp = IntGdiGetCharSet(hDC);
// If here, update everything!
Dc = DC_LockDc(hDC);
- Dc_Attr = Dc->pDc_Attr;
- if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
if (!Dc)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0;
}
+ Dc_Attr = Dc->pDc_Attr;
+ if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
Dc_Attr->iCS_CP = cscp;
Dc_Attr->ulDirty_ &= ~DIRTY_CHARSET;
DC_UnlockDc( Dc );