mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Do not read past the end of the argument string if it is empty.
This commit is contained in:
parent
299d4f3aaa
commit
4382538e4b
@ -211,6 +211,8 @@ args_escape(const char *s)
|
||||
char *escaped, *result;
|
||||
int flags;
|
||||
|
||||
if (*s == '\0')
|
||||
return (xstrdup(s));
|
||||
if ((strchr(quoted, s[0]) != NULL || s[0] == '~') && s[1] == '\0') {
|
||||
xasprintf(&escaped, "\\%c", s[0]);
|
||||
return (escaped);
|
||||
|
Loading…
Reference in New Issue
Block a user