diff --git a/external/bsd/libarchive/dist/tar/write.c b/external/bsd/libarchive/dist/tar/write.c index 1c4fcb43b6a4..9c813992992b 100644 --- a/external/bsd/libarchive/dist/tar/write.c +++ b/external/bsd/libarchive/dist/tar/write.c @@ -798,7 +798,9 @@ copy_file_data_block(struct bsdtar *bsdtar, struct archive *a, progress += bytes_written; } if (r < ARCHIVE_WARN) { - lafe_warnc(archive_errno(a), "%s", archive_error_string(a)); + const char *s = archive_error_string(a); + if (s) + lafe_warnc(archive_errno(a), "%s", s); return (-1); } return (0);