]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Cast isprint(3) argument to unsigned char to avoid undefined behavior.
authorChristos Zoulas <christos@zoulas.com>
Sat, 8 May 2021 20:07:04 +0000 (16:07 -0400)
committerChristos Zoulas <christos@zoulas.com>
Sat, 8 May 2021 20:07:04 +0000 (16:07 -0400)
libarchive/archive_read_support_format_mtree.c

index 93ba2959a3c67de0dabae505be39deb228e44362..c5ce01853c84cfee214b66dd9c3d55421ab92ba0 100644 (file)
@@ -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;
                        }