Testing fixes for security improvement, thread safety, and memory management.

This commit is contained in:
Storm Dragon
2025-06-09 14:41:33 -04:00
parent 62e1001679
commit 6998706934
7 changed files with 19 additions and 10 deletions

View File

@ -44,10 +44,14 @@ class driver(soundDriver):
return
if interrupt:
self.cancel()
# Validate file path to prevent injection
import os
if not os.path.isfile(filePath) or '..' in filePath:
return
popenSoundFileCommand = shlex.split(self.soundFileCommand)
for idx, word in enumerate(popenSoundFileCommand):
word = word.replace('fenrirVolume', str(self.volume ))
word = word.replace('fenrirSoundFile', str(filePath))
word = word.replace('fenrirSoundFile', shlex.quote(str(filePath)))
popenSoundFileCommand[idx] = word
self.proc = subprocess.Popen(popenSoundFileCommand, shell=False)
self.soundType = 'file'