mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
tr: fix "access past the end of a string" bug 4354
This commit is contained in:
parent
df96df9c7c
commit
5e40070d38
@ -138,7 +138,7 @@ static unsigned int expand(const char *arg, char *buffer)
|
||||
arg += 3; /* skip CHAR=] */
|
||||
continue;
|
||||
}
|
||||
if (*arg != '-') { /* not [x-...] - copy verbatim */
|
||||
if (i == '\0' || *arg != '-') { /* not [x-...] - copy verbatim */
|
||||
*buffer++ = '[';
|
||||
arg--; /* points to x */
|
||||
continue; /* copy all, including eventual ']' */
|
||||
|
Loading…
Reference in New Issue
Block a user