diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-08-07 12:46:40 +0200 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-08-07 10:46:40 +0000 |
commit | 43abfff43537092e20bc129f8208d082e73aff1a (patch) | |
tree | 0a474a6ecf44fd9b0090d75f0f528fb9b55e62ce /modules/pam_access | |
parent | 4020ca8c0fe3ac88eccc5c62aa8d8c63a4043578 (diff) | |
download | pam-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_access')
-rw-r--r-- | modules/pam_access/pam_access.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 985dc7de..04d7306b 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -456,7 +456,7 @@ login_access (pam_handle_t *pamh, struct login_info *item) } if (line[0] == '#') continue; /* comment line */ - while (end > 0 && isspace(line[end - 1])) + while (end > 0 && isspace((unsigned char)line[end - 1])) end--; line[end] = 0; /* strip trailing whitespace */ if (line[0] == 0) /* skip blank lines */ |