13
0

Be more strict about possible track/route names

The GUI `RouteUI::verify_new_route_name` checks for colons.
This left the session vulnerable, from calling set_name
from other places (e.g. ctrl surfaces).
This commit is contained in:
Robin Gareus 2024-05-26 00:13:40 +02:00
parent 4a14f2fed5
commit 5b746b186a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -355,6 +355,13 @@ Route::~Route ()
string
Route::ensure_track_or_route_name (string newname) const
{
/* remove any colons (and other nasty chars) */
newname = legalize_for_universal_path (newname);
/* Some ctrl surfaces may put NULL in the middle of a string.
* Ben found out just how much havoc this can wreak. SysEx 1s 4 b1tch. */
newname.erase (std::remove (newname.begin(), newname.end(), '\0'), newname.end());
while (!_session.io_name_is_legal (newname)) {
newname = bump_name_once (newname, ' ');
if (newname == name()) {