diff options
author | ache <ache@FreeBSD.org> | 2002-08-03 10:23:06 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-08-03 10:23:06 +0000 |
commit | 5e42992e9605d84b1c82d785b2c3afc0fa5c9693 (patch) | |
tree | c6eae7253ce8ebabd7414ca2511b2208163354c3 /lib | |
parent | b6a6d004ff40fbdb0d42759bf770214592ca16ea (diff) | |
download | FreeBSD-src-5e42992e9605d84b1c82d785b2c3afc0fa5c9693.zip FreeBSD-src-5e42992e9605d84b1c82d785b2c3afc0fa5c9693.tar.gz |
Check encoding for ".", ".." and / inside
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/setrunelocale.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index e9cee2e..4d3cf0e 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -61,7 +61,11 @@ setrunelocale(encoding) char name[PATH_MAX]; _RuneLocale *rl; - if (!encoding || strlen(encoding) > ENCODING_LEN) + if (!encoding || strlen(encoding) > ENCODING_LEN || + (encoding[0] == '.' && + (encoding[1] == '\0' || + (encoding[1] == '.' && encoding[2] == '\0'))) || + strchr(encoding, '/') != NULL) return (EINVAL); /* |