diff options
author | Rob Landley <rob@landley.net> | 2014-06-09 05:51:04 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-06-09 05:51:04 -0500 |
commit | 89a62bf2907412cb562d22c875736357e314c8c8 (patch) | |
tree | 0dbb98c25b73f9320c090c7aeceb98ea2fe23fa6 /toys/posix/expand.c | |
parent | c421b7068c5dd95baa10f9bd97e578d04ba48c70 (diff) | |
download | toybox-89a62bf2907412cb562d22c875736357e314c8c8.tar.gz |
When locale is enabled, sprintf("%.123s", str) is counting characters, not bytes, so we can't globally enable locale without opening stack/heap smashing vulnerabilities. Make commands individually request setlocale() using TOYFLAGS instead.
Diffstat (limited to 'toys/posix/expand.c')
-rw-r--r-- | toys/posix/expand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/expand.c b/toys/posix/expand.c index e23dc273..7e668fa7 100644 --- a/toys/posix/expand.c +++ b/toys/posix/expand.c @@ -4,7 +4,7 @@ * * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/expand.html -USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN)) +USE_EXPAND(NEWTOY(expand, "t*", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE)) config EXPAND bool "expand" |