setupapi: remove invalid check for < MAX_PATH and don't copy to NULL PathBuffer (Coverity 888)
Ricardo Filipe
ricardojdfilipe at gmail.com
Mon Mar 23 12:12:05 CDT 2009
i had thought of fixing this some time ago but it slipped through with other
work i'm having...
thanks to James Hawkins for bringing it up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090323/73de8ec7/attachment.htm>
-------------- next part --------------
From cec61c6e7e1a24d434a99130b3f602f4ba8f4073 Mon Sep 17 00:00:00 2001
From: Ricardo Filipe <ricardo_barbano at hotmail.com>
Date: Mon, 23 Mar 2009 17:05:59 +0000
Subject: setupapi: remove invalid check for < MAX_PATH and don't copy to NULL
PathBuffer (Coverity 888)
---
dlls/setupapi/dialog.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/setupapi/dialog.c b/dlls/setupapi/dialog.c
index 21135cd..948fa74 100644
--- a/dlls/setupapi/dialog.c
+++ b/dlls/setupapi/dialog.c
@@ -108,13 +108,12 @@ static void promptdisk_ok(HWND hwnd, struct promptdisk_params *params)
*params->PathRequiredSize = requiredSize;
TRACE("returning PathRequiredSize=%d\n",*params->PathRequiredSize);
}
- if(!params->PathBuffer && !params->PathBufferSize)
+ if(!params->PathBuffer)
{
EndDialog(hwnd, NO_ERROR);
return;
}
- if(params->PathBuffer && (requiredSize > params->PathBufferSize
- || params->PathBufferSize < MAX_PATH))
+ if(requiredSize > params->PathBufferSize)
{
EndDialog(hwnd, DPROMPT_BUFFERTOOSMALL);
return;
--
1.5.6.3
More information about the wine-patches
mailing list