[PATCH] winhelp: Add proper NULL pointer check to prevent crash.

Elias Benali elptr at users.sourceforge.net
Mon Apr 28 09:32:42 CDT 2008


Changelog :
* This fixed a segmentation fault upon access to a null ptr.

---
 programs/winhelp/winhelp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index fd605a9..c73b29f 100644
--- a/programs/winhelp/winhelp.c
+++ b/programs/winhelp/winhelp.c
@@ -575,7 +575,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*
wpage, int nCmdShow, BOOL remembe
                 }
                 SetWindowPos(win->hMainWnd, HWND_TOP, pt.x, pt.y,
sz.cx, sz.cy, flags);

-                if (wpage->page && wpage->page->file != win->page->file)
+                if (wpage->page && win->page && wpage->page->file !=
win->page->file)
                     WINHELP_DeleteBackSet(win);
                 WINHELP_InitFonts(win->hMainWnd);

--
1.5.4.3
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-winhelp-Add-proper-NULL-pointer-check-to-prevent-cras.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20080428/75a67cb4/attachment-0001.txt 


More information about the wine-patches mailing list