mirror of
https://github.com/sheumann/hush.git
synced 2025-01-14 12:30:40 +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=] */
|
arg += 3; /* skip CHAR=] */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (*arg != '-') { /* not [x-...] - copy verbatim */
|
if (i == '\0' || *arg != '-') { /* not [x-...] - copy verbatim */
|
||||||
*buffer++ = '[';
|
*buffer++ = '[';
|
||||||
arg--; /* points to x */
|
arg--; /* points to x */
|
||||||
continue; /* copy all, including eventual ']' */
|
continue; /* copy all, including eventual ']' */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user