Skip to content

Commit

Permalink
zip2john: avoid usage of uninit members of ctx
Browse files Browse the repository at this point in the history
`if (ctx.archive.zip64) {` is used uninitialized if `ctx.archive.zip64 =
zip64;` is not executed. Memset'ing the whole struct at the beginning of
the function avoids this problem.
  • Loading branch information
lucic71 authored and solardiz committed Apr 28, 2024
1 parent cfb7444 commit 59f1bbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zip2john.c
Expand Up @@ -993,7 +993,7 @@ static void scan_central_index(const char *fname)
uint32_t this_disk, cd_start_disk;
uint64_t num_records, num_records_total;
uint64_t cd_size, cd_start_offset;
zip_context ctx;
zip_context ctx = {};

if (!(fp = fopen(fname, "rb"))) {
fprintf(stderr, "! %s : %s\n", fname, strerror(errno));
Expand Down

0 comments on commit 59f1bbe

Please sign in to comment.