Author: janderwald
Date: Sat Dec 19 22:44:39 2009
New Revision: 44660
URL:
http://svn.reactos.org/svn/reactos?rev=44660&view=rev
Log:
[MMIXER]
- Fix buffer overflow
Modified:
trunk/reactos/lib/drivers/sound/mmixer/controls.c
Modified: trunk/reactos/lib/drivers/sound/mmixer/controls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/c…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] Sat Dec 19 22:44:39
2009
@@ -576,8 +576,12 @@
if (LineName)
{
- wcscpy(DestinationLine->Line.szShortName, LineName);
- wcscpy(DestinationLine->Line.szName, LineName);
+ MixerContext->Copy(DestinationLine->Line.szShortName, LineName,
(min(MIXER_SHORT_NAME_CHARS, wcslen(LineName)+1)) * sizeof(WCHAR));
+ DestinationLine->Line.szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0';
+
+ MixerContext->Copy(DestinationLine->Line.szName, LineName,
(min(MIXER_LONG_NAME_CHARS, wcslen(LineName)+1)) * sizeof(WCHAR));
+ DestinationLine->Line.szName[MIXER_LONG_NAME_CHARS-1] = L'\0';
+
}
else
{