From 3558418ed7242b2b3003da9efb7eab4d95007581 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 5 Feb 2015 11:12:33 -0800 Subject: [PATCH] Initializing soundEntry and using something safer than strcpy --- extensions/sdktools/vsound.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/sdktools/vsound.cpp b/extensions/sdktools/vsound.cpp index 18d3e46d..cbf2da5c 100644 --- a/extensions/sdktools/vsound.cpp +++ b/extensions/sdktools/vsound.cpp @@ -357,9 +357,9 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann char buffer[PLATFORM_MAX_PATH]; strcpy(buffer, pSample); - char soundEntry[PLATFORM_MAX_PATH]; + char soundEntry[PLATFORM_MAX_PATH] = ""; #if SOURCE_ENGINE >= SE_PORTAL2 - strcpy(soundEntry, pSoundEntry); + Q_strncpy(soundEntry, pSoundEntry, sizeof(soundEntry)); #endif #if SOURCE_ENGINE < SE_PORTAL2 @@ -493,9 +493,9 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan char buffer[PLATFORM_MAX_PATH]; strcpy(buffer, pSample); - char soundEntry[PLATFORM_MAX_PATH]; + char soundEntry[PLATFORM_MAX_PATH] = ""; #if SOURCE_ENGINE >= SE_PORTAL2 - strcpy(soundEntry, pSoundEntry); + Q_strncpy(soundEntry, pSoundEntry, sizeof(soundEntry)); #endif #if SOURCE_ENGINE < SE_PORTAL2