Commit 94c1c8e5 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

avifil32: Use matching buffer length for dest string (Coverity).

Reported issue is about potential overflow when copying to fixed size buffer from larger source buffer Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a411ef99
......@@ -1036,14 +1036,16 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
return AVIERR_ERROR;
}
for (n = 0;RegEnumKeyW(hKey, n, szFileExt, sizeof(szFileExt)/sizeof(szFileExt[0])) == ERROR_SUCCESS;n++) {
WCHAR clsidW[40];
/* get CLSID to extension */
size = sizeof(szValue);
if (RegQueryValueW(hKey, szFileExt, szValue, &size) != ERROR_SUCCESS)
size = sizeof(clsidW);
if (RegQueryValueW(hKey, szFileExt, clsidW, &size) != ERROR_SUCCESS)
break;
/* search if the CLSID is already known */
for (i = 1; i <= count; i++) {
if (lstrcmpW(lp[i].szClsid, szValue) == 0)
if (lstrcmpW(lp[i].szClsid, clsidW) == 0)
break; /* a new one */
}
......@@ -1058,7 +1060,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
break;
}
lstrcpyW(lp[i].szClsid, szValue);
lstrcpyW(lp[i].szClsid, clsidW);
count++;
}
......
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