From 483a68aaf2a6107e8a0859042d8fad015cab401b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 18 May 2024 13:42:37 +0200 Subject: [PATCH] Avoided use of uninitialized variables which was introduced by commit d9c548d --- libisofs/fs_image.c | 7 +++---- libisofs/tree.c | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index 302a7ac..fae4790 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -4496,7 +4496,6 @@ int iso_analyze_gpt(IsoImage *image, IsoDataSource *src, int flag) { int ret, i, j; uint64_t start_block, block_count, flags, end_block, j_end, j_start; - uint32_t next_above; uint8_t *part; struct iso_imported_sys_area *sai; struct iso_gpt_partition_request *gpt_entry; @@ -4591,7 +4590,7 @@ int iso_analyze_gpt(IsoImage *image, IsoDataSource *src, int flag) continue; ret = iso_tree_get_node_of_block(image, NULL, (uint32_t) (gpt_entry->start_block / 4), - &node, &next_above, 0); + &node, NULL, 0); if (ret > 0) gpt_entry->image_path = iso_tree_get_node_path(node); } @@ -4627,7 +4626,7 @@ static int iso_analyze_apm(IsoImage *image, IsoDataSource *src, int flag) { int ret, i; - uint32_t map_entries, start_block, block_count, flags, next_above; + uint32_t map_entries, start_block, block_count, flags; char *sad, *part, name[33], type_string[33]; struct iso_imported_sys_area *sai; struct iso_apm_partition_request *apm_entry; @@ -4688,7 +4687,7 @@ int iso_analyze_apm(IsoImage *image, IsoDataSource *src, int flag) ret = iso_tree_get_node_of_block(image, NULL, (uint32_t) (apm_entry->start_block / (2048 / sai->apm_block_size)), - &node, &next_above, 0); + &node, NULL, 0); if (ret > 0) apm_entry->image_path = iso_tree_get_node_path(node); } diff --git a/libisofs/tree.c b/libisofs/tree.c index 43e3f2d..f107898 100644 --- a/libisofs/tree.c +++ b/libisofs/tree.c @@ -1294,6 +1294,8 @@ ex:; } /* Note: No reference is taken to the found node. + Warning: Do not submit next_above uninitialized. + Submit NULL if next_above is not of interest. @param flag bit0= recursion */ int iso_tree_get_node_of_block(IsoImage *image, IsoDir *dir, uint32_t block,