diff options
author | Martin Matuska <martin@matuska.de> | 2022-12-08 15:08:14 +0100 |
---|---|---|
committer | Martin Matuska <martin@matuska.de> | 2022-12-08 15:08:14 +0100 |
commit | 186116ce9a312929656fb977e57ec49aaee099c2 (patch) | |
tree | 1fb61daa15e69f8976b1da02d25329713868fc90 | |
parent | 0d7cc9a041461ba03de90476db2c9bcb0a391112 (diff) | |
download | libarchive-186116ce9a312929656fb977e57ec49aaee099c2.tar.gz |
various: fix unitialized local variables
Reported by: GitHub CodeQL
Code scanning alerts: 214, 215, 216
-rw-r--r-- | libarchive/archive_read_support_format_iso9660.c | 2 | ||||
-rw-r--r-- | libarchive/archive_string.c | 6 | ||||
-rw-r--r-- | libarchive/archive_write_disk_posix.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c index cd7f92f4..33bf330c 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 d7f2c46b..69458e1a 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 4793878b..09a5eef0 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; |