Disallow '/' characters in LC_* environment variables which might
be used to point to a bad locale file. This is only believed to be a minor security risk - the only risk is if some program uses the result of a localized string as a format specifier in a vulnerable function like sprintf(). No such code is believed to exist in the FreeBSD base system, although it is possible that badly written third party code would do that. Submitted by: imp Approved by: ache
This commit is contained in:
parent
5d888c38ed
commit
a1158cce42
@ -129,7 +129,7 @@ setlocale(category, locale)
|
||||
if (!env || !*env)
|
||||
env = getenv("LANG");
|
||||
|
||||
if (!env || !*env)
|
||||
if (!env || !*env || strchr(env, '/'))
|
||||
env = "C";
|
||||
|
||||
(void) strncpy(new_categories[category], env, ENCODING_LEN);
|
||||
|
Loading…
Reference in New Issue
Block a user