diff options
author | nicm <nicm> | 2019-05-28 18:30:30 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-05-28 18:30:30 +0000 |
commit | 4382538e4bac2849262710c447e4b630e7f34bd7 (patch) | |
tree | 618a526dcdbb3c05b773f167fc144b8ba4f5a13c | |
parent | 299d4f3aaa801ee79920fadcb802ca51b0d639ec (diff) | |
download | rtmux-4382538e4bac2849262710c447e4b630e7f34bd7.tar.gz rtmux-4382538e4bac2849262710c447e4b630e7f34bd7.tar.bz2 rtmux-4382538e4bac2849262710c447e4b630e7f34bd7.zip |
Do not read past the end of the argument string if it is empty.
-rw-r--r-- | arguments.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arguments.c b/arguments.c index 68690deb..54bc3593 100644 --- a/arguments.c +++ b/arguments.c @@ -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); |