mirror of https://github.com/mirror/busybox.git
tr: fix "access past the end of a string" bug 4354
parent
df96df9c7c
commit
5e40070d38
coreutils
|
@ -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…
Reference in New Issue