From 7ed22b481f47681887bdf1068c910e2a67d688a7 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 12 May 2023 14:36:09 -0400 Subject: opk/read: Make GCC 12 analyzer STFU What a mess. Fixes most of analyzer*.log (thousands of lines of error messages). --- (limited to 'analyzer.log') diff --git a/analyzer.log b/analyzer.log new file mode 100644 index 0000000..b20476d --- /dev/null +++ b/analyzer.log @@ -0,0 +1,2581 @@ + CC src/opk/opkg_opk-read.o +src/opk/read.c: In function ‘_opkg_opk_opk_read_control’: +src/opk/read.c:155:25: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 155 | free(path); + | ^~~~~~~~~~ + ‘_opkg_opk_opk_read_control’: events 1-5 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (2) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (3) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (4) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (5) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 6-8 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (6) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (7) following ‘true’ branch... + | 58 | fputs(_("Error: Failed to initialize\n"), stderr); + | | ~~~~~ + | | | + | | (8) ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 9-14 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(9) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (10) following ‘true’ branch... + | 154 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (12) following ‘true’ branch... + | | (11) ...to here + | 155 | free(path); + | | ~~~~~~~~~~ + | | | + | | (13) ...to here + | | (14) use of uninitialized value ‘path’ here + | +src/opk/read.c:155:25: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 155 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-28 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘true’ branch... + | 58 | fputs(_("Error: Failed to initialize\n"), stderr); + | | ~~~~~ + | | | + | | (28) ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 29-34 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(29) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (30) following ‘true’ branch... + | 154 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (32) following ‘true’ branch... + | | (31) ...to here + | 155 | free(path); + | | ~~~~~~~~~~ + | | | + | | (33) ...to here + | | (34) use of uninitialized value ‘path’ here + | +src/opk/read.c:179:33: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 179 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-38 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 178 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (36) following ‘true’ branch... + | 179 | free(path); + | | ~~~~~~~~~~ + | | | + | | (37) ...to here + | | (38) use of uninitialized value ‘path’ here + | +src/opk/read.c:186:29: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 186 | if (sprintf(path, "%s/%s", opk->control_dir, + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 187 | member->name) <= 0) { + | ~~~~~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-38 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ + | | | + | | (37) ...to here + | 186 | if (sprintf(path, "%s/%s", opk->control_dir, + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (38) use of uninitialized value ‘path’ here + | 187 | member->name) <= 0) { + | | ~~~~~~~~~~~~~ + | +src/opk/read.c:190:33: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 190 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-38 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ + | | | + | | (37) ...to here + |...... + | 190 | free(path); + | | ~~~~~~~~~~ + | | | + | | (38) use of uninitialized value ‘path’ here + | +src/opk/read.c:199:33: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 199 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-40 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ + | | | + | | (37) ...to here + | 186 | if (sprintf(path, "%s/%s", opk->control_dir, + | | ~ + | | | + | | (38) following ‘false’ branch... + |...... + | 193 | fp = fopen(path, "wb"); + | | ~~ + | | | + | | (39) ...to here + |...... + | 199 | free(path); + | | ~~~~~~~~~~ + | | | + | | (40) use of uninitialized value ‘path’ here + | +src/opk/read.c:238:57: warning: use of uninitialized value ‘fp’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 238 | if (opk->control_dir != NULL && fwrite(buffer, 1, size, + | ^~~~~~~~~~~~~~~~~~~~~~~ + 239 | fp) != size) { + | ~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 124 | FILE *fp; + | | ~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-42 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (38) following ‘false’ branch... + | | (37) ...to here + |...... + | 205 | if (opk->list_control > 0) { + | | ~~ + | | | + | | (39) ...to here + |...... + | 238 | if (opk->control_dir != NULL && fwrite(buffer, 1, size, + | | ~ ~~~~~~~~~~~~~~~~~~~~~~~ + | | | | + | | | (41) ...to here + | | | (42) use of uninitialized value ‘fp’ here + | | (40) following ‘true’ branch... + | 239 | fp) != size) { + | | ~~~ + | +src/opk/read.c:243:33: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 243 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-42 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (38) following ‘false’ branch... + | | (37) ...to here + |...... + | 205 | if (opk->list_control > 0) { + | | ~~ + | | | + | | (39) ...to here + |...... + | 238 | if (opk->control_dir != NULL && fwrite(buffer, 1, size, + | | ~ + | | | + | | (40) following ‘true’ branch... + | 239 | fp) != size) { + | 240 | fputs(_("Error: Failed to write control file\n") + | | ~~~~~ + | | | + | | (41) ...to here + |...... + | 243 | free(path); + | | ~~~~~~~~~~ + | | | + | | (42) use of uninitialized value ‘path’ here + | +src/opk/read.c:252:33: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 252 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-39 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (38) following ‘false’ branch... + | | (37) ...to here + |...... + | 205 | if (opk->list_control > 0) { + | | ~~ + | | | + | | (39) ...to here + | + ‘_opkg_opk_opk_read_control’: events 40-44 + | + | 226 | &buffer, &size)) == OPKG_OPK_OK) + |...... + | 247 | if (ret_read == OPKG_OPK_ERROR) { + | | ~~ + | | | + | | (41) ...to here + |...... + | 251 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (42) following ‘true’ branch... + | 252 | free(path); + | | ~~~~~~~~~~ + | | | + | | (43) ...to here + | | (44) use of uninitialized value ‘path’ here + | +src/opk/read.c:253:33: warning: use of uninitialized value ‘fp’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 253 | fclose(fp); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 124 | FILE *fp; + | | ~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-39 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (38) following ‘false’ branch... + | | (37) ...to here + |...... + | 205 | if (opk->list_control > 0) { + | | ~~ + | | | + | | (39) ...to here + | + ‘_opkg_opk_opk_read_control’: events 40-44 + | + | 226 | &buffer, &size)) == OPKG_OPK_OK) + |...... + | 247 | if (ret_read == OPKG_OPK_ERROR) { + | | ~~ + | | | + | | (41) ...to here + |...... + | 251 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (42) following ‘true’ branch... + | 252 | free(path); + | | ~~~~ + | | | + | | (43) ...to here + | 253 | fclose(fp); + | | ~~~~~~~~~~ + | | | + | | (44) use of uninitialized value ‘fp’ here + | +src/opk/read.c:255:25: warning: leak of FILE ‘fp’ [CWE-775] [-Wanalyzer-file-leak] + 255 | return OPKG_OPK_ERROR; + | ^~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-24 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (22) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (23) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (24) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 25-28 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (26) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (27) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (28) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 29 + | + |cc1: + | (29): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 30-31 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(30) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (31) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 32 + | + |cc1: + | (32): ...to here + | + ‘_opkg_opk_opk_read_control’: events 33-45 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (34) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (35) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ + | | | + | | (36) ...to here + | 186 | if (sprintf(path, "%s/%s", opk->control_dir, + | | ~ + | | | + | | (37) following ‘false’ branch... + |...... + | 193 | fp = fopen(path, "wb"); + | | ~~ ~~~~~~~~~~~~~~~~~ + | | | | + | | | (39) opened here + | | (38) ...to here + | 194 | if (fp == NULL) { + | | ~ + | | | + | | (40) assuming ‘fp’ is non-NULL + | | (41) following ‘false’ branch (when ‘fp’ is non-NULL)... + |...... + | 205 | if (opk->list_control > 0) { + | | ~~ ~ + | | | | + | | | (43) following ‘false’ branch... + | | (42) ...to here + |...... + | 211 | if (opk->print_control_head != NULL && + | | ~~ + | | | + | | (44) ...to here + |...... + | 222 | if (print == 1 && opk->previously_printed == 1) { + | | ~ + | | | + | | (45) following ‘false’ branch (when ‘print != 1’)... + | + ‘_opkg_opk_opk_read_control’: event 46 + | + |cc1: + | (46): ...to here + | + ‘_opkg_opk_opk_read_control’: events 47-49 + | + | 251 | if (opk->control_dir != NULL) { + | | ^ + | | | + | | (47) following ‘false’ branch... + |...... + | 255 | return OPKG_OPK_ERROR; + | | ~~~~~~ + | | | + | | (48) ...to here + | | (49) ‘fp’ leaks here; was opened at (39) + | +src/opk/read.c:261:29: warning: use of uninitialized value ‘fp’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 261 | if (fclose(fp) != 0) { + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 124 | FILE *fp; + | | ~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-39 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (38) following ‘false’ branch... + | | (37) ...to here + |...... + | 205 | if (opk->list_control > 0) { + | | ~~ + | | | + | | (39) ...to here + | + ‘_opkg_opk_opk_read_control’: events 40-44 + | + | 226 | &buffer, &size)) == OPKG_OPK_OK) + |...... + | 247 | if (ret_read == OPKG_OPK_ERROR) { + | | ~~ ~ + | | | | + | | | (42) following ‘false’ branch (when ‘ret_read != -1’)... + | | (41) ...to here + |...... + | 257 | opk->previously_printed = 1; + | | ~~~ + | | | + | | (43) ...to here + |...... + | 261 | if (fclose(fp) != 0) { + | | ~~~~~~~~~~ + | | | + | | (44) use of uninitialized value ‘fp’ here + | +src/opk/read.c:263:33: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 263 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-37 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 163 | buffer = member->name; + | | ~~~~~~ + | | | + | | (35) ...to here + |...... + | 173 | if (member->type != '-') { + | | ~ + | | | + | | (36) following ‘false’ branch... + |...... + | 185 | if (opk->control_dir != NULL) { + | | ~~ + | | | + | | (37) ...to here + | + ‘_opkg_opk_opk_read_control’: events 38-42 + | + | 226 | &buffer, &size)) == OPKG_OPK_OK) + |...... + | 247 | if (ret_read == OPKG_OPK_ERROR) { + | | ~~ ~ + | | | | + | | | (40) following ‘false’ branch (when ‘ret_read != -1’)... + | | (39) ...to here + |...... + | 257 | opk->previously_printed = 1; + | | ~~~ + | | | + | | (41) ...to here + |...... + | 263 | free(path); + | | ~~~~~~~~~~ + | | | + | | (42) use of uninitialized value ‘path’ here + | +src/opk/read.c:270:17: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 270 | free(path); + | ^~~~~~~~~~ + ‘_opkg_opk_opk_read_control’: events 1-5 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (2) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (3) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (4) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (5) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 6-9 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (6) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (7) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (8) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (9) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 10 + | + |cc1: + | (10): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 11-12 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(11) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (12) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 13 + | + |cc1: + | (13): ...to here + | + ‘_opkg_opk_opk_read_control’: events 14-18 + | + | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + |...... + | 268 | if (opk->control_dir != NULL) { + | | ~~ ~ + | | | | + | | | (16) following ‘true’ branch... + | | (15) ...to here + | 269 | /* Done with path buffer. */ + | 270 | free(path); + | | ~~~~~~~~~~ + | | | + | | (17) ...to here + | | (18) use of uninitialized value ‘path’ here + | +src/opk/read.c:270:17: warning: use of uninitialized value ‘path’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] + 270 | free(path); + | ^~~~~~~~~~ + ‘opkg_opk_opk_read’: events 1-20 + | + | 509 | opkg_opk_opk_read(struct opkg_opk_opk *opk, const char *file_name) + | | ^~~~~~~~~~~~~~~~~ + | | | + | | (1) entry to ‘opkg_opk_opk_read’ + |...... + | 520 | if (opk->file == NULL) { + | | ~ + | | | + | | (2) following ‘false’ branch... + |...... + | 528 | opk->outer_gzip = opkg_opk_gzip_init_read(&_opkg_opk_opk_read_file, + | | ~~~ + | | | + | | (3) ...to here + | 529 | opk); + | 530 | if (opk->outer_gzip == NULL) { + | | ~ + | | | + | | (4) following ‘false’ branch... + |...... + | 537 | opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); + | | ~~~ + | | | + | | (5) ...to here + | 538 | if (opk->outer_ustar == NULL) { + | | ~ + | | | + | | (6) following ‘false’ branch... + |...... + | 545 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (8) following ‘false’ branch... + | | (7) ...to here + |...... + | 551 | if (strcmp(member->name, "debian-binary") != 0) { + | | ~~ ~ + | | | | + | | | (10) following ‘false’ branch (when the strings are equal)... + | | (9) ...to here + |...... + | 558 | free(member); + | | ~~~~ + | | | + | | (11) ...to here + | 559 | if (opkg_opk_ustar_read(opk->outer_ustar, + | | ~ + | | | + | | (12) following ‘false’ branch... + |...... + | 567 | if (version_size < 4 || strncmp(version_buffer, "2.", 2) != 0) { + | | ~~ ~ + | | | | + | | | (14) following ‘false’ branch... + | | (13) ...to here + |...... + | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) { + | | ~~ ~ + | | | | + | | | (16) following ‘false’ branch... + | | (15) ...to here + |...... + | 579 | if (strcmp(member->name, "control.tar.gz") != 0) { + | | ~~ ~ + | | | | + | | | (18) following ‘false’ branch (when the strings are equal)... + | | (17) ...to here + |...... + | 585 | free(member); + | | ~~~~ + | | | + | | (19) ...to here + | 586 | if (_opkg_opk_opk_read_control(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (20) calling ‘_opkg_opk_opk_read_control’ from ‘opkg_opk_opk_read’ + | + +--> ‘_opkg_opk_opk_read_control’: events 21-25 + | + | 118 | _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (21) entry to ‘_opkg_opk_opk_read_control’ + |...... + | 121 | char *path; + | | ~~~~ + | | | + | | (22) region created on stack here + |...... + | 131 | if (opk->control_dir != NULL) { + | | ~ + | | | + | | (23) following ‘false’ branch... + |...... + | 148 | } else if (opk->list_control == 0 && opk->print_control_head == NULL) { + | | ~~ + | | | + | | (24) ...to here + |...... + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (25) calling ‘_opkg_opk_opk_read_init_inner’ from ‘_opkg_opk_opk_read_control’ + | + +--> ‘_opkg_opk_opk_read_init_inner’: events 26-29 + | + | 51 | _opkg_opk_opk_read_init_inner(struct opkg_opk_opk *opk) + | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | | + | | (26) entry to ‘_opkg_opk_opk_read_init_inner’ + |...... + | 57 | if (opk->inner_gzip == NULL) { + | | ~ + | | | + | | (27) following ‘false’ branch... + |...... + | 63 | opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip); + | | ~~~ + | | | + | | (28) ...to here + | 64 | if (opk->inner_ustar == NULL) { + | | ~ + | | | + | | (29) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_init_inner’: event 30 + | + |cc1: + | (30): ...to here + | + <------+ + | + ‘_opkg_opk_opk_read_control’: events 31-32 + | + | 153 | if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) { + | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | || + | | |(31) returning to ‘_opkg_opk_opk_read_control’ from ‘_opkg_opk_opk_read_init_inner’ + | | (32) following ‘false’ branch... + | + ‘_opkg_opk_opk_read_control’: event 33 + | + |cc1: + | (33): ...to here + | + ‘_opkg_opk_opk_read_control’: events 34-36 + | + | 268 | if (opk->control_dir != NULL) { + | | ^ + | | | + | | (34) following ‘true’ branch... + | 269 | /* Done with path buffer. */ + | 270 | free(path); + | | ~~~~~~~~~~ + | | | + | | (35) ...to here + | | (36) use of uninitialized value ‘path’ here + | +src/opk/read.c: In function ‘opkg_opk_opk_read’: +src/opk/read.c:435:58: warning: ‘s/’ directive output may be truncated writing 2 bytes into a region of size between 0 and 18 [-Wformat-truncation=] + 435 | snprintf(fmt , sizeof(fmt ), "%%c%%s %%-%zus/%%-%zus %%%lid %%s ", + | ^~ +In function ‘_opkg_opk_opk_read_data’, + inlined from ‘opkg_opk_opk_read’ at src/opk/read.c:604:6: +src/opk/read.c:435:44: note: directive argument in the range [0, 9223372036854775805] + 435 | snprintf(fmt , sizeof(fmt ), "%%c%%s %%-%zus/%%-%zus %%%lid %%s ", + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src/opk/read.c:435:9: note: ‘snprintf’ output between 23 and 78 bytes into a destination of size 26 + 435 | snprintf(fmt , sizeof(fmt ), "%%c%%s %%-%zus/%%-%zus %%%lid %%s ", + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 436 | uname_len_max, gname_len_max, size_len_max); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src/opk/read.c: In function ‘opkg_opk_opk_read’: +src/opk/read.c:437:63: warning: ‘%zu’ directive output may be truncated writing between 1 and 19 bytes into a region of size between 0 and 18 [-Wformat-truncation=] + 437 | snprintf(fmt_dev, sizeof(fmt_dev), "%%c%%s %%-%zus/%%-%zus " + | ^~~ +In function ‘_opkg_opk_opk_read_data’, + inlined from ‘opkg_opk_opk_read’ at src/opk/read.c:604:6: +src/opk/read.c:437:44: note: directive argument in the range [0, 9223372036854775805] + 437 | snprintf(fmt_dev, sizeof(fmt_dev), "%%c%%s %%-%zus/%%-%zus " + | ^~~~~~~~~~~~~~~~~~~~~~~~~ +src/opk/read.c:437:44: note: directive argument in the range [-9223372036854775808, 9223372036854775805] +src/opk/read.c:437:9: note: ‘snprintf’ output between 28 and 102 bytes into a destination of size 30 + 437 | snprintf(fmt_dev, sizeof(fmt_dev), "%%c%%s %%-%zus/%%-%zus " + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 438 | "%%%lid, %%%lid %%s ", + | ~~~~~~~~~~~~~~~~~~~~~~ + 439 | uname_len_max, gname_len_max, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 440 | size_len_max - devminor_len_max - 2, devminor_len_max); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In function ‘_opkg_opk_opk_read_control’, + inlined from ‘opkg_opk_opk_read’ at src/opk/read.c:586:6: +src/opk/read.c:253:33: warning: ‘fp’ may be used uninitialized [-Wmaybe-uninitialized] + 253 | fclose(fp); + | ^~~~~~~~~~ +src/opk/read.c: In function ‘opkg_opk_opk_read’: +src/opk/read.c:124:41: note: ‘fp’ was declared here + 124 | FILE *fp; + | ^~ +In function ‘_opkg_opk_opk_read_control’, + inlined from ‘opkg_opk_opk_read’ at src/opk/read.c:586:6: +src/opk/read.c:193:30: warning: ‘path’ may be used uninitialized [-Wmaybe-uninitialized] + 193 | fp = fopen(path, "wb"); + | ^~~~~~~~~~~~~~~~~ +src/opk/read.c: In function ‘opkg_opk_opk_read’: +src/opk/read.c:121:41: note: ‘path’ was declared here + 121 | char *path; + | ^~~~ -- cgit v0.9.1