diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-08-07 12:46:27 +0200 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-08-07 10:46:40 +0000 |
commit | 65b5747e32067ffd1980ef06360737b3c30b0feb (patch) | |
tree | 1dab52c52d6149d35b57f2134bc70cf2d807b423 /libpam/pam_start.c | |
parent | 2770046cd8c24eae69625f7cbab0b6995008bbf7 (diff) | |
download | pam-65b5747e32067ffd1980ef06360737b3c30b0feb.tar.gz pam-65b5747e32067ffd1980ef06360737b3c30b0feb.tar.bz2 pam-65b5747e32067ffd1980ef06360737b3c30b0feb.zip |
libpam: 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 'libpam/pam_start.c')
-rw-r--r-- | libpam/pam_start.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpam/pam_start.c b/libpam/pam_start.c index 1fc36b3e..5e9b0948 100644 --- a/libpam/pam_start.c +++ b/libpam/pam_start.c @@ -67,7 +67,7 @@ static int _pam_start_internal ( char *tmp; for (tmp=(*pamh)->service_name; *tmp; ++tmp) - *tmp = tolower(*tmp); /* require lower case */ + *tmp = tolower((unsigned char)*tmp); /* require lower case */ } if (user) { |