From 277c2536ce1b3a269e8a6ce7298905340945d89c Mon Sep 17 00:00:00 2001 From: millert Date: Sun, 15 Mar 2020 16:34:57 +0000 Subject: Add missing casts to unsigned char when using ctype(3). From Hiltjo Posthuma --- mail.lmtp.c | 6 +++--- smtp_session.c | 4 ++-- spfwalk.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mail.lmtp.c b/mail.lmtp.c index f427e73d..c7dc46d5 100644 --- a/mail.lmtp.c +++ b/mail.lmtp.c @@ -255,9 +255,9 @@ lmtp_engine(int fd_read, struct session *session) line[strcspn(line, "\r")] = '\0'; if (linelen < 4 || - !isdigit(line[0]) || - !isdigit(line[1]) || - !isdigit(line[2]) || + !isdigit((unsigned char)line[0]) || + !isdigit((unsigned char)line[1]) || + !isdigit((unsigned char)line[2]) || (line[3] != ' ' && line[3] != '-')) errx(EX_TEMPFAIL, "LMTP server sent an invalid line"); diff --git a/smtp_session.c b/smtp_session.c index 87ae18a6..d6c45b92 100644 --- a/smtp_session.c +++ b/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.424 2020/02/03 15:53:52 gilles Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.425 2020/03/15 16:34:57 millert Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -452,7 +452,7 @@ header_address_rewrite_buffer(char *buffer, const char *address, size_t len) pos_component_beg = 0; else { for (pos_component_beg = pos_component_end; pos_component_beg >= 0; --pos_component_beg) - if (buffer[pos_component_beg] == ')' || isspace(buffer[pos_component_beg])) + if (buffer[pos_component_beg] == ')' || isspace((unsigned char)buffer[pos_component_beg])) break; pos_component_beg += 1; pos_component_end += 1; diff --git a/spfwalk.c b/spfwalk.c index 97104eb9..130c7221 100644 --- a/spfwalk.c +++ b/spfwalk.c @@ -95,7 +95,7 @@ spfwalk(int argc, struct parameter *argv) tgt.dispatch = dispatch_txt; while ((linelen = getline(&line, &linesize, stdin)) != -1) { - while (linelen-- > 0 && isspace(line[linelen])) + while (linelen-- > 0 && isspace((unsigned char)line[linelen])) line[linelen] = '\0'; if (linelen > 0) -- cgit v1.2.3-59-g8ed1b