From: Martin Matuska Date: Thu, 8 Dec 2022 14:08:14 +0000 (+0100) Subject: various: fix unitialized local variables X-Git-Tag: v3.6.2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=186116ce9a312929656fb977e57ec49aaee099c2;p=thirdparty%2Flibarchive.git various: fix unitialized local variables Reported by: GitHub CodeQL Code scanning alerts: 214, 215, 216 --- diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c index cd7f92f46..33bf330cb 100644 --- a/libarchive/archive_read_support_format_iso9660.c +++ b/libarchive/archive_read_support_format_iso9660.c @@ -1757,7 +1757,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent, size_t name_len; const unsigned char *rr_start, *rr_end; const unsigned char *p; - size_t dr_len; + size_t dr_len = 0; uint64_t fsize, offset; int32_t location; int flags; diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index d7f2c46b2..69458e1a1 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -3988,10 +3988,10 @@ int archive_mstring_get_mbs_l(struct archive *a, struct archive_mstring *aes, const char **p, size_t *length, struct archive_string_conv *sc) { - int r, ret = 0; - - (void)r; /* UNUSED */ + int ret = 0; #if defined(_WIN32) && !defined(__CYGWIN__) + int r; + /* * Internationalization programming on Windows must use Wide * characters because Windows platform cannot make locale UTF-8. diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 4793878bf..09a5eef03 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -2795,7 +2795,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, char *tail; char *head; int last; - char c; + char c = '\0'; int r; struct stat st; int chdir_fd;