mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
- Exhumed: handle unterminated strings in LoadSound without reading beyond their end.
This commit is contained in:
parent
f98765ce95
commit
12b25df582
1 changed files with 4 additions and 3 deletions
|
@ -181,11 +181,12 @@ TArray<uint8_t> EXSoundEngine::ReadSound(int lumpnum)
|
|||
|
||||
int LoadSound(const char* name)
|
||||
{
|
||||
FString nname(name, 8);
|
||||
int sndid = soundEngine->FindSoundNoHash(nname.GetChars());
|
||||
char nname[9]{};
|
||||
for (int i = 0; i < 8 && name[i]; i++) nname[i] = name[i];
|
||||
int sndid = soundEngine->FindSoundNoHash(nname);
|
||||
if (sndid > 0) return sndid - 1;
|
||||
|
||||
FStringf filename("%s.voc", nname.GetChars());
|
||||
FStringf filename("%s.voc", nname);
|
||||
auto lump = S_LookupSound(filename);
|
||||
if (lump > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue