Skip to content

Commit

Permalink
Prevent overflowing VST2 program name buffers (surge-synthesizer#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima authored and baconpaul committed Sep 10, 2019
1 parent ba36b33 commit 80596ee
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/vst2/Vst2PluginInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,8 @@ bool Vst2PluginInstance::getProgramNameIndexed (VstInt32 category, VstInt32 inde
if (tryInit())
{
SurgeSynthesizer* s = (SurgeSynthesizer*)_instance;
/*
** The original surge had this 63. Presume it is documented somewhere in vst land.
*/
strncpy(text, s->storage.getPatch().name.c_str(), 63);
strncpy(text, s->storage.getPatch().name.c_str(), kVstMaxProgNameLen);
text[kVstMaxProgNameLen - 1] = '\0';
}
return true;
}
Expand Down

0 comments on commit 80596ee

Please sign in to comment.