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_modutil_searchkey.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_modutil_searchkey.c')
-rw-r--r-- | libpam/pam_modutil_searchkey.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpam/pam_modutil_searchkey.c b/libpam/pam_modutil_searchkey.c index ba023e52..6e577728 100644 --- a/libpam/pam_modutil_searchkey.c +++ b/libpam/pam_modutil_searchkey.c @@ -103,14 +103,14 @@ pam_modutil_search_key(pam_handle_t *pamh UNUSED, tmp = strchr(cp, '#'); /* remove comments */ if (tmp) *tmp = '\0'; - while (isspace((int)*cp)) /* remove spaces and tabs */ + while (isspace((unsigned char)*cp)) /* remove spaces and tabs */ ++cp; if (*cp == '\0') /* ignore empty lines */ continue; tmp = strsep (&cp, " \t="); if (cp != NULL) - while (isspace((int)*cp) || *cp == '=') + while (isspace((unsigned char)*cp) || *cp == '=') ++cp; else cp = buf + n; /* empty string */ |