diff options
-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); /* |