From: Christos Zoulas Date: Sat, 8 May 2021 20:07:04 +0000 (-0400) Subject: Cast isprint(3) argument to unsigned char to avoid undefined behavior. X-Git-Tag: v3.5.2~19^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e597f8bfee283684e8f9bbdc7a835662d4551144;p=thirdparty%2Flibarchive.git Cast isprint(3) argument to unsigned char to avoid undefined behavior. --- diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 93ba2959a..c5ce01853 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -1074,7 +1074,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree) continue; /* Non-printable characters are not allowed */ for (s = p;s < p + len - 1; s++) { - if (!isprint(*s)) { + if (!isprint((unsigned char)*s)) { r = ARCHIVE_FATAL; break; }