mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[MMIXER]
- Fix buffer overflow - Dedicated to irc:igorko svn path=/trunk/; revision=47782
This commit is contained in:
@@ -638,9 +638,16 @@ MMixerGetDeviceName(
|
||||
Status = MixerContext->QueryKeyValue(hKey, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
|
||||
if (Status == MM_STATUS_SUCCESS)
|
||||
{
|
||||
ASSERT(Length < MAXPNAMELEN);
|
||||
wcscpy(MixerInfo->MixCaps.szPname, Name);
|
||||
// copy device name
|
||||
MixerContext->Copy(MixerInfo->MixCaps.szPname, Name, min(wcslen(Name), MAXPNAMELEN-1) * sizeof(WCHAR));
|
||||
|
||||
// make sure its null terminated
|
||||
MixerInfo->MixCaps.szPname[MAXPNAMELEN-1] = L'\0';
|
||||
|
||||
// free device name
|
||||
MixerContext->Free(Name);
|
||||
|
||||
// done
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -651,8 +658,13 @@ MMixerGetDeviceName(
|
||||
Status = MixerContext->QueryKeyValue(hKey, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
|
||||
if (Status == MM_STATUS_SUCCESS)
|
||||
{
|
||||
ASSERT(Length < MAXPNAMELEN);
|
||||
wcscpy(MixerInfo->MixCaps.szPname, Name);
|
||||
// copy device name
|
||||
MixerContext->Copy(MixerInfo->MixCaps.szPname, Name, min(wcslen(Name), MAXPNAMELEN-1) * sizeof(WCHAR));
|
||||
|
||||
// make sure its null terminated
|
||||
MixerInfo->MixCaps.szPname[MAXPNAMELEN-1] = L'\0';
|
||||
|
||||
// free device name
|
||||
MixerContext->Free(Name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user