projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ff30d4
)
(__option_is_short): Check upper limit of __key.
author
Sergey Poznyakoff
<gray@gnu.org.ua>
Thu, 16 Jun 2005 11:52:34 +0000
(11:52 +0000)
committer
Sergey Poznyakoff
<gray@gnu.org.ua>
Thu, 16 Jun 2005 11:52:34 +0000
(11:52 +0000)
Isprint() requires its argument to have the value of an
unsigned char or EOF.
lib/argp.h
patch
|
blob
|
history
diff --git
a/lib/argp.h
b/lib/argp.h
index 9bd2030ff44670e9f80e4572086b2775a703a146..f06542aeb576c59dff711270b3622b53557db360 100644
(file)
--- a/
lib/argp.h
+++ b/
lib/argp.h
@@
-23,6
+23,7
@@
#include <stdio.h>
#include <ctype.h>
#include <getopt.h>
+#include <limits.h>
#define __need_error_t
#include <errno.h>
@@
-579,7
+580,7
@@
__NTH (__option_is_short (__const struct argp_option *__opt))
else
{
int __key = __opt->key;
- return __key > 0 && isprint (__key);
+ return __key > 0 &&
__key <= UCHAR_MAX &&
isprint (__key);
}
}