From 67510a2294dfb27c7a28c3bfd86665f6cd1d8506 Mon Sep 17 00:00:00 2001 From: serassio <> Date: Sat, 12 Mar 2005 03:11:34 +0000 Subject: [PATCH] Bug #1259: Incorrect use of ctype functions Forward port of 2.5 patch. --- helpers/basic_auth/MSNT/smbencrypt.c | 8 ++++---- helpers/ntlm_auth/SMB/smbval/smbencrypt.c | 2 +- helpers/ntlm_auth/fakeauth/fakeauth_auth.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helpers/basic_auth/MSNT/smbencrypt.c b/helpers/basic_auth/MSNT/smbencrypt.c index 0ab8a94123..6e9361f8a7 100644 --- a/helpers/basic_auth/MSNT/smbencrypt.c +++ b/helpers/basic_auth/MSNT/smbencrypt.c @@ -194,16 +194,16 @@ strupper(char *s) } else if (is_kana(*s)) { s++; } else { - if (islower(*s)) - *s = toupper(*s); + if (islower((int)(unsigned char)*s)) + *s = toupper((int)(unsigned char)*s); s++; } } else #endif /* KANJI_WIN95_COMPATIBILITY */ #endif /* UNUSED_CODE */ { - if (islower(*s)) - *s = toupper(*s); + if (islower((int)(unsigned char)*s)) + *s = toupper((int)(unsigned char)*s); s++; } } diff --git a/helpers/ntlm_auth/SMB/smbval/smbencrypt.c b/helpers/ntlm_auth/SMB/smbval/smbencrypt.c index 3aff3cbf1f..008b240841 100644 --- a/helpers/ntlm_auth/SMB/smbval/smbencrypt.c +++ b/helpers/ntlm_auth/SMB/smbval/smbencrypt.c @@ -199,7 +199,7 @@ strupper(char *s) * else * #endif *//* KANJI_WIN95_COMPATIBILITY */ { - if (islower(*s)) + if (islower((int)(unsigned char)*s)) *s = toupper(*s); s++; } diff --git a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c index b83a7bf3b4..b74a2b4bda 100644 --- a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c +++ b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c @@ -176,7 +176,7 @@ ntlmGetString(ntlmhdr * hdr, strhdr * str, int flags) d = buf; for (; l; l--) { - if (*sc == '\0' || !isprint(*sc)) { + if (*sc == '\0' || !isprint((int)(unsigned char)*sc)) { fprintf(stderr, "ntlmGetString: bad ascii: %04x\n", *sc); return (NULL); } -- 2.47.3