aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/tr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 28798fe4f..860b8122b 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -135,6 +135,8 @@ static unsigned int expand(const char *arg, char *buffer)
/* "[xyz...", i=x, arg points to y */
if (ENABLE_FEATURE_TR_EQUIV && i == '=') { /* [=CHAR=] */
*buffer++ = *arg; /* copy CHAR */
+ if (!*arg || arg[1] != '=' || arg[2] != ']')
+ bb_show_usage();
arg += 3; /* skip CHAR=] */
continue;
}