Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp ftp: fix undefined behavior when parsing FEAT



details:   https://anonhg.NetBSD.org/src/rev/1925251c9d5c
branches:  trunk
changeset: 1023141:1925251c9d5c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 27 17:35:03 2021 +0000

description:
ftp: fix undefined behavior when parsing FEAT

lint says: warning: argument to 'function from <ctype.h>' must be cast
to 'unsigned char', not to 'int' [342]

diffstat:

 usr.bin/ftp/util.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b6a1103381c7 -r 1925251c9d5c usr.bin/ftp/util.c
--- a/usr.bin/ftp/util.c        Fri Aug 27 17:31:48 2021 +0000
+++ b/usr.bin/ftp/util.c        Fri Aug 27 17:35:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.162 2021/04/25 08:26:35 lukem Exp $ */
+/*     $NetBSD: util.c,v 1.163 2021/08/27 17:35:03 rillig Exp $        */
 
 /*-
  * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.162 2021/04/25 08:26:35 lukem Exp $");
+__RCSID("$NetBSD: util.c,v 1.163 2021/08/27 17:35:03 rillig Exp $");
 #endif /* not lint */
 
 /*
@@ -171,7 +171,7 @@
                         * work-around broken ProFTPd servers that can't
                         * even obey RFC 2389.
                         */
-       while (*fline && isspace((int)*fline))
+       while (*fline && isspace((unsigned char)*fline))
                fline++;
 
        if (strcasecmp(fline, "MDTM") == 0)



Home | Main Index | Thread Index | Old Index