https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2bbc94c6ac2ea062d16bf…
commit 2bbc94c6ac2ea062d16bf9b1ee20ba05920d9ed4
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Feb 1 12:40:38 2020 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Feb 8 13:08:27 2020 +0100
[MMIXER] Fix overzealous asserts. CORE-16611
MAXPNAMELEN is the size of the array, so if wcslen returns MAXPNAMELEN-1,
the null terminator fits and everything is okay.
---
sdk/lib/drivers/sound/mmixer/midi.c | 2 +-
sdk/lib/drivers/sound/mmixer/wave.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sdk/lib/drivers/sound/mmixer/midi.c b/sdk/lib/drivers/sound/mmixer/midi.c
index d659381de0b..969f252773a 100644
--- a/sdk/lib/drivers/sound/mmixer/midi.c
+++ b/sdk/lib/drivers/sound/mmixer/midi.c
@@ -72,7 +72,7 @@ MMixerAddMidiPin(
MidiInfo->PinId = PinId;
/* sanity check */
- ASSERT(!DeviceName || (wcslen(DeviceName) + 1 < MAXPNAMELEN));
+ ASSERT(!DeviceName || (wcslen(DeviceName) < MAXPNAMELEN));
/* copy device name */
if (bInput && DeviceName)
diff --git a/sdk/lib/drivers/sound/mmixer/wave.c b/sdk/lib/drivers/sound/mmixer/wave.c
index 962934b8d5c..6326e3227d7 100644
--- a/sdk/lib/drivers/sound/mmixer/wave.c
+++ b/sdk/lib/drivers/sound/mmixer/wave.c
@@ -357,7 +357,7 @@ MMixerInitializeWaveInfo(
WaveInfo->PinId = Pins[0];
/* sanity check */
- ASSERT(wcslen(DeviceName) + 1 < MAXPNAMELEN);
+ ASSERT(wcslen(DeviceName) < MAXPNAMELEN);
/* copy device name */
if (bWaveIn)