setupapi: Remove invalid check for < MAX_PATH and don't copy to NULL PathBuffer (Coverity 888).

This commit is contained in:
Ricardo Filipe 2009-03-23 17:05:59 +00:00 committed by Alexandre Julliard
parent 78a7ea5a39
commit 1999008b89
1 changed files with 2 additions and 3 deletions

View File

@ -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;