[comdlg32] Move NULL check before use (Coverity)
Paul Vriens
Paul.Vriens at xs4all.nl
Sat Oct 7 09:48:49 CDT 2006
Hi,
this one was marked as BUG and easy to fix. We shouldn't use lpChFont before
the NULL check is done.
Fixed CID-653.
Changelog
Move NULL check before use
Cheers,
Paul.
---
dlls/comdlg32/fontdlg16.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/comdlg32/fontdlg16.c b/dlls/comdlg32/fontdlg16.c
index a90dca2..3f3264f 100644
--- a/dlls/comdlg32/fontdlg16.c
+++ b/dlls/comdlg32/fontdlg16.c
@@ -174,12 +174,13 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT1
LOGFONT16 *font16;
SEGPTR lpTemplateName;
- cf32w.lpLogFont=&lf32w;
- CFn_CHOOSEFONT16to32W(lpChFont, &cf32w);
-
TRACE("ChooseFont\n");
+
if (!lpChFont) return FALSE;
+ cf32w.lpLogFont=&lf32w;
+ CFn_CHOOSEFONT16to32W(lpChFont, &cf32w);
+
if (TRACE_ON(commdlg))
_dump_cf_flags(lpChFont->Flags);
--
1.4.2.3
More information about the wine-patches
mailing list