mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Forbid empty session names, GitHub issue 2758.
This commit is contained in:
@ -53,6 +53,11 @@ cmd_rename_session_exec(struct cmd *self, struct cmdq_item *item)
|
||||
|
||||
tmp = format_single_from_target(item, args->argv[0]);
|
||||
newname = session_check_name(tmp);
|
||||
if (newname == NULL) {
|
||||
cmdq_error(item, "invalid session: %s", tmp);
|
||||
free(tmp);
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
free(tmp);
|
||||
if (strcmp(newname, s->name) == 0) {
|
||||
free(newname);
|
||||
|
Reference in New Issue
Block a user