aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_namespace/argv_parse.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-08-07 12:46:40 +0200
committerDmitry V. Levin <ldv@strace.io>2023-08-07 10:46:40 +0000
commit43abfff43537092e20bc129f8208d082e73aff1a (patch)
tree0a474a6ecf44fd9b0090d75f0f528fb9b55e62ce /modules/pam_namespace/argv_parse.c
parent4020ca8c0fe3ac88eccc5c62aa8d8c63a4043578 (diff)
downloadpam-43abfff43537092e20bc129f8208d082e73aff1a.tar.gz
pam-43abfff43537092e20bc129f8208d082e73aff1a.tar.bz2
pam-43abfff43537092e20bc129f8208d082e73aff1a.zip
modules: cast to unsigned char for character handling function
Character handling functions, like isspace(3), expect a value representable as unsigned char or equal to EOF. Otherwise the behavior is undefined. See https://wiki.sei.cmu.edu/confluence/display/c/STR37-C.+Arguments+to+character-handling+functions+must+be+representable+as+an+unsigned+char
Diffstat (limited to 'modules/pam_namespace/argv_parse.c')
-rw-r--r--modules/pam_namespace/argv_parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/pam_namespace/argv_parse.c b/modules/pam_namespace/argv_parse.c
index 40510542..7d418e05 100644
--- a/modules/pam_namespace/argv_parse.c
+++ b/modules/pam_namespace/argv_parse.c
@@ -56,7 +56,7 @@ int argv_parse(const char *in_buf, int *ret_argc, char ***ret_argv)
outcp = buf;
for (cp = in_buf; (ch = *cp); cp++) {
if (state == STATE_WHITESPACE) {
- if (isspace((int) ch))
+ if (isspace((unsigned char)ch))
continue;
/* Not whitespace, so start a new token */
state = STATE_TOKEN;
@@ -81,7 +81,7 @@ int argv_parse(const char *in_buf, int *ret_argc, char ***ret_argv)
continue;
}
/* Must be processing characters in a word */
- if (isspace((int) ch)) {
+ if (isspace((unsigned char)ch)) {
/*
* Terminate the current word and start
* looking for the beginning of the next word.