diff options
author | tjr <tjr@FreeBSD.org> | 2005-10-17 12:20:05 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2005-10-17 12:20:05 +0000 |
commit | ecdaf1ccb7bca9e328cd3aae155b214b5118d324 (patch) | |
tree | f3df0d502e3131b80e673c1fc5b2a429b39e908a /contrib | |
parent | cc449adce9f146bf14d0f6ec9d08bb0845df007a (diff) | |
download | FreeBSD-src-ecdaf1ccb7bca9e328cd3aae155b214b5118d324.zip FreeBSD-src-ecdaf1ccb7bca9e328cd3aae155b214b5118d324.tar.gz |
In __option_is_short(), avoid calling isprint() on key characters outside
the range allowed by that function, resulting in undefined behaviour.
Our undefined behaviour in multibyte locales happened to differ from
glibc's, resulting in errors parsing option strings.
Obtained from: Corinna Vinschen (Red Hat)
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/cpio/lib/argp.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/cpio/lib/argp.h b/contrib/cpio/lib/argp.h index 0c65a4c..57635e8 100644 --- a/contrib/cpio/lib/argp.h +++ b/contrib/cpio/lib/argp.h @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + /* Hierarchial argument parsing, layered over getopt. Copyright (C) 1995-1999,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -579,7 +581,7 @@ __NTH (__option_is_short (__const struct argp_option *__opt)) else { int __key = __opt->key; - return __key > 0 && isprint (__key); + return __key > 0 && __key < 256 && isprint (__key); } } |