aboutsummaryrefslogtreecommitdiff
path: root/libpamc
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-08-07 12:46:33 +0200
committerDmitry V. Levin <ldv@strace.io>2023-08-07 10:46:40 +0000
commit4020ca8c0fe3ac88eccc5c62aa8d8c63a4043578 (patch)
treef2fa28c83e3977c78bc99a370bc04b0b2d6489ef /libpamc
parent65b5747e32067ffd1980ef06360737b3c30b0feb (diff)
downloadpam-4020ca8c0fe3ac88eccc5c62aa8d8c63a4043578.tar.gz
pam-4020ca8c0fe3ac88eccc5c62aa8d8c63a4043578.tar.bz2
pam-4020ca8c0fe3ac88eccc5c62aa8d8c63a4043578.zip
libpamc: 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 'libpamc')
-rw-r--r--libpamc/pamc_load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpamc/pamc_load.c b/libpamc/pamc_load.c
index b4fa78b3..69fb8b87 100644
--- a/libpamc/pamc_load.c
+++ b/libpamc/pamc_load.c
@@ -324,7 +324,7 @@ int __pamc_valid_agent_id(int id_length, const char *id)
for (i=post=0 ; i < id_length; ++i) {
int ch = id[i++];
- if (isalpha(ch) || isdigit(ch) || (ch == '_')) {
+ if (isalpha((unsigned char)ch) || isdigit((unsigned char)ch) || (ch == '_')) {
continue;
} else if (post && (ch == '.')) {
continue;