[PATCH] winex11.drv: check NULL before calling (Coverity)

Marcus Meissner marcus at jet.franken.de
Tue Dec 1 16:47:34 CST 2009


Hi,

Move the bSubst=... code using lpResource inside
the if() (where the only user of bSubst lives),
as XFONT_GetStringItem does not like NULL pointers.

Ciao, Marcus
---
 dlls/winex11.drv/xfont.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c
index a45a3a3..57e84a4 100644
--- a/dlls/winex11.drv/xfont.c
+++ b/dlls/winex11.drv/xfont.c
@@ -1690,9 +1690,9 @@ static void XFONT_LoadAliases( HKEY hkey )
 
 	XFONT_InitialCapitals(buffer);
 	lpResource = XFONT_GetStringItem( buffer );
-	bSubst = (XFONT_GetStringItem( lpResource )) ? TRUE : FALSE;
 	if( lpResource && *lpResource )
 	{
+            bSubst = (XFONT_GetStringItem( lpResource )) ? TRUE : FALSE;
             if (LFD_Parse(lpResource, &lfd)) XFONT_LoadAlias(&lfd, buffer, bSubst);
 	}
 	else
-- 
1.5.6



More information about the wine-patches mailing list