Commit 4d998184 authored by Douglas Ridgway's avatar Douglas Ridgway Committed by Alexandre Julliard

Fix crash if lpuCurDirLen or lpuDestDirLen==0.

parent f3f08f16
......@@ -274,9 +274,11 @@ DWORD WINAPI VerFindFileA(
if(lpuDestDirLen && lpszDestDir) {
if(*lpuDestDirLen < destDirSizeReq) {
retval |= VFF_BUFFTOOSMALL;
if (*lpuDestDirLen) {
strncpy(lpszDestDir, destDir, *lpuDestDirLen - 1);
lpszDestDir[*lpuDestDirLen - 1] = '\0';
}
}
else
strcpy(lpszDestDir, destDir);
......@@ -286,8 +288,10 @@ DWORD WINAPI VerFindFileA(
if(lpuCurDirLen && lpszCurDir) {
if(*lpuCurDirLen < curDirSizeReq) {
retval |= VFF_BUFFTOOSMALL;
if (*lpuCurDirLen) {
strncpy(lpszCurDir, curDir, *lpuCurDirLen - 1);
lpszCurDir[*lpuCurDirLen - 1] = '\0';
}
}
else
strcpy(lpszCurDir, curDir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment