comdlg32: Avoid possible NULL pointer dereference (Coverity) (try2)

Kai Blin kai.blin at
Tue Oct 14 05:56:16 CDT 2008

As the code checks for ofnW->lpstrFile not being NULL, it seems like
PathFindFileNameW() and PathFindExtensionW() don't make sense on NULL
ofnW->lpstrFile. If offset and extension are not updated, it doesn't make
sense to call UpdateResults. So just abort if ofnW->lpstrFile is NULL.

This fixes Coverity CID 108
 dlls/comdlg32/filedlg31.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3ebe1cc0ef5890897bf2474b79637c0a9f2ba199.diff
Type: text/x-patch
Size: 639 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list