Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tc.os.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,21 @@ bs2cmdlist(char *str)
}
if (strlen(str_beg) != 0)
{
const char *p;
int sq = 0, dq = 0;

for (p = str_beg; *p != '\0'; p++)
{
if (*p == '\'' && !dq)
sq = !sq;
else if (*p == '"' && !sq)
dq = !dq;
else if (!sq && !dq && strchr("&|<>$\140\n\r", *p) != NULL)
{
stderror(ERR_NAME | ERR_STRING, "unsafe character in command");
return -1;
}
}
ret = bs2system(str_beg);
flush();
if (ret != 0 /*&& !option.err_ignore*/)
Expand Down
Loading