summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-05-12 14:36:09 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-05-12 15:01:23 (EDT)
commit7ed22b481f47681887bdf1068c910e2a67d688a7 (patch)
treefbbb8fa9d825fe0d68a41b3774c8a3f6d6274f28
parent01231ee43570d1de5f133a966b1d04bc68008b38 (diff)
opk/read: Make GCC 12 analyzer STFU
What a mess. Fixes most of analyzer*.log (thousands of lines of error messages).
-rw-r--r--analyzer.color.log3048
-rw-r--r--analyzer.log2581
-rw-r--r--src/opk/read.c40
3 files changed, 5669 insertions, 0 deletions
diff --git a/analyzer.color.log b/analyzer.color.log
new file mode 100644
index 0000000..fa9f9a3
--- /dev/null
+++ b/analyzer.color.log
@@ -0,0 +1,3048 @@
+ CC src/opk/opkg_opk-read.o
+src/opk/read.c: In function ‘_opkg_opk_opk_read_data’:
+src/opk/read.c:435:55: warning: ‘%zu’ directive output may be truncated writing between 1 and 20 bytes into a region of size 19 [-Wformat-truncation=]
+ 435 | snprintf(fmt , sizeof(fmt ), "%%c%%s %%-%zus/%%-%zus %%%lid %%s ",
+ | ^~~
+src/opk/read.c:435:9: note: ‘snprintf’ output between 23 and 80 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:437:62: warning: ‘-’ directive output may be truncated writing 1 byte into a region of size between 0 and 19 [-Wformat-truncation=]
+ 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]
+ 437 | snprintf(fmt_dev, sizeof(fmt_dev), "%%c%%s %%-%zus/%%-%zus "
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~
+src/opk/read.c:437:9: note: ‘snprintf’ output between 28 and 104 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);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (11) ...to here
+ | | (12) following ‘true’ branch...
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (31) ...to here
+ | | (32) following ‘true’ branch...
+ | 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_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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (10) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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-22
+ |
+ | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) ==
+ |......
+ | 163 | buffer = member->name;
+ | | ~~
+ | | |
+ | | (15) ...to here
+ |......
+ | 167 | if (buffer[0] == '\0') {
+ | | ~
+ | | |
+ | | (16) following ‘false’ branch...
+ |......
+ | 173 | if (member->type != '-') {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘true’ branch...
+ | 174 | fputs(_("Error: Non-regular control files not supported"
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | |
+ | | (19) ...to here
+ | 175 |  "\n"), stderr);
+ | | ~~~~~~~~~~~~~~
+ |......
+ | 178 | if (opk->control_dir != NULL) {
+ | | ~
+ | | |
+ | | (20) following ‘true’ branch...
+ | 179 | free(path);
+ | | ~~~~~~~~~~
+ | | |
+ | | (21) ...to here
+ | | (22) 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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_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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (10) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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-22
+ |
+ | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) ==
+ |......
+ | 163 | buffer = member->name;
+ | | ~~
+ | | |
+ | | (15) ...to here
+ |......
+ | 167 | if (buffer[0] == '\0') {
+ | | ~
+ | | |
+ | | (16) following ‘false’ branch...
+ |......
+ | 173 | if (member->type != '-') {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch...
+ |......
+ | 185 | if (opk->control_dir != NULL) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (19) ...to here
+ | | (20) following ‘true’ branch...
+ | 186 | if (sprintf(path, "%s/%s", opk->control_dir,
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | |
+ | | (21) ...to here
+ | | (22) use of uninitialized value ‘path’ here
+ | 187 |  member->name) <= 0) {
+ | | ~~~~~~~~~~~~~
+ |
+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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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_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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (10) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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-24
+ |
+ | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) ==
+ |......
+ | 163 | buffer = member->name;
+ | | ~~
+ | | |
+ | | (15) ...to here
+ |......
+ | 167 | if (buffer[0] == '\0') {
+ | | ~
+ | | |
+ | | (16) following ‘false’ branch...
+ |......
+ | 173 | if (member->type != '-') {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch...
+ |......
+ | 185 | if (opk->control_dir != NULL) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (19) ...to here
+ | | (20) following ‘true’ branch...
+ | 186 | if (sprintf(path, "%s/%s", opk->control_dir,
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(21) ...to here
+ | | (22) following ‘true’ branch...
+ | 187 |  member->name) <= 0) {
+ | | ~~~~~~~~~~~~~
+ | 188 | free(member);
+ | | ~~~~~~~~~~~~
+ | | |
+ | | (23) ...to here
+ | 189 | _opkg_opk_opk_read_free_inner(opk);
+ | 190 | free(path);
+ | | ~~~~~~~~~~
+ | | |
+ | | (24) use of uninitialized value ‘path’ here
+ |
+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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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_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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (10) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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-26
+ |
+ | 160 | while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) ==
+ |......
+ | 163 | buffer = member->name;
+ | | ~~
+ | | |
+ | | (15) ...to here
+ |......
+ | 167 | if (buffer[0] == '\0') {
+ | | ~
+ | | |
+ | | (16) following ‘false’ branch...
+ |......
+ | 173 | if (member->type != '-') {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch...
+ |......
+ | 185 | if (opk->control_dir != NULL) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (19) ...to here
+ | | (20) following ‘true’ branch...
+ | 186 | if (sprintf(path, "%s/%s", opk->control_dir,
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(21) ...to here
+ | | (22) following ‘false’ branch...
+ | 187 |  member->name) <= 0) {
+ | | ~~~~~~~~~~~~~
+ |......
+ | 193 | fp = fopen(path, "wb");
+ | | ~~~~~~~~~~~~~~~~~
+ | | |
+ | | (23) ...to here
+ | 194 | if (fp == NULL) {
+ | | ~
+ | | |
+ | | (24) following ‘true’ branch (when ‘fp’ is NULL)...
+ | 195 | fputs(_("Error: Failed to extract control file"
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | |
+ | | (25) ...to here
+ | 196 |  "\n"), stderr);
+ | | ~~~~~~~~~~~~~~
+ |......
+ | 199 | free(path);
+ | | ~~~~~~~~~~
+ | | |
+ | | (26) 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (37) ...to here
+ | | (38) following ‘false’ branch...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (37) ...to here
+ | | (38) following ‘false’ branch...
+ |......
+ | 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
+ | 241 |  , stderr);
+ | | ~~~~~~~~~
+ | 242 | _opkg_opk_opk_read_free_inner(opk);
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (37) ...to here
+ | | (38) following ‘false’ branch...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (37) ...to here
+ | | (38) following ‘false’ branch...
+ |......
+ | 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
+ |
+In file included from src/opk/read.c:26:
+src/opk/../defs.h:25:24: warning: leak of FILE ‘fp’ [CWE-775] [-Wanalyzer-file-leak]
+ 25 | #define OPKG_OPK_ERROR -1
+ | ^
+src/opk/read.c:255:32: note: in expansion of macro ‘OPKG_OPK_ERROR’
+ 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (29) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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");
+ | | ~~~~~~~~~~~~~~~~~
+ | | |
+ | | (38) ...to here
+ | | (39) opened 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) {
+ | | ~~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (42) ...to here
+ | | (43) following ‘false’ branch...
+ |......
+ | 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’: event 47
+ |
+ | 251 | if (opk->control_dir != NULL) {
+ | | ^
+ | | |
+ | | (47) following ‘false’ branch...
+ |
+ ‘_opkg_opk_opk_read_control’: event 48
+ |
+ |src/opk/../defs.h:25:24:
+ | 25 | #define OPKG_OPK_ERROR -1
+ | | ^
+ | | |
+ | | (48) ...to here
+src/opk/read.c:255:32: note: in expansion of macro ‘OPKG_OPK_ERROR’
+ | 255 | return OPKG_OPK_ERROR;
+ | | ^~~~~~~~~~~~~~
+ |
+ ‘_opkg_opk_opk_read_control’: event 49
+ |
+ |src/opk/../defs.h:25:24:
+ | 25 | #define OPKG_OPK_ERROR -1
+ | | ^
+ | | |
+ | | (49) ‘fp’ leaks here; was opened at (39)
+src/opk/read.c:255:32: note: in expansion of macro ‘OPKG_OPK_ERROR’
+ | 255 | return OPKG_OPK_ERROR;
+ | | ^~~~~~~~~~~~~~
+ |
+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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (37) ...to here
+ | | (38) following ‘false’ branch...
+ |......
+ | 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
+ | | (42) following ‘false’ branch (when ‘ret_read != -1’)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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) {
+ | | ~
+ | | |
+ | | (39) ...to here
+ | | (40) following ‘false’ branch (when ‘ret_read != -1’)...
+ |......
+ | 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’: 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) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(7) ...to here
+ | | (8) following ‘false’ branch...
+ |......
+ | 551 | if (strcmp(member->name, "debian-binary") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (9) ...to here
+ | | (10) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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) {
+ | | ~~~~~~~~~~~~~~~~~
+ | | | |
+ | | | (13) ...to here
+ | | (14) following ‘false’ branch...
+ |......
+ | 574 | if (opkg_opk_ustar_list(opk->outer_ustar, &member) != OPKG_OPK_OK) {
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | | ||
+ | | |(15) ...to here
+ | | (16) following ‘false’ branch...
+ |......
+ | 579 | if (strcmp(member->name, "control.tar.gz") != 0) {
+ | | ~ ~~
+ | | | |
+ | | | (17) ...to here
+ | | (18) following ‘false’ branch (when the strings are equal)...
+ |......
+ | 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
+ |
+ |src/opk/../defs.h:23:25:
+ | 23 | #define OPKG_OPK_OK 0
+ | | ^
+ | | |
+ | | (30) ...to here
+src/opk/read.c:70:16: note: in expansion of macro ‘OPKG_OPK_OK’
+ | 70 | return OPKG_OPK_OK;
+ | | ^~~~~~~~~~~
+ |
+ <------+
+ |
+ ‘_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
+ |
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;
+ | ^~~~
diff --git a/src/opk/read.c b/src/opk/read.c
index 768f64d..2d9f439 100644
--- a/src/opk/read.c
+++ b/src/opk/read.c
@@ -140,6 +140,8 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
"\n"), stderr);
return OPKG_OPK_ERROR;
}
+/* For below #pragmas: path initialized here
+ * (opk->control_dir != NULL). */
path = malloc(strlen(opk->control_dir) +
OPKG_OPK_USTAR_NAME_SIZE + 1);
if (path == NULL) {
@@ -152,7 +154,11 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) {
if (opk->control_dir != NULL) {
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
free(path);
+# pragma GCC diagnostic pop
}
return OPKG_OPK_ERROR;
}
@@ -176,27 +182,42 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
free(member);
_opkg_opk_opk_read_free_inner(opk);
if (opk->control_dir != NULL) {
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
free(path);
+# pragma GCC diagnostic pop
}
return OPKG_OPK_ERROR;
}
/* Open file for extraction. */
if (opk->control_dir != NULL) {
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
if (sprintf(path, "%s/%s", opk->control_dir,
member->name) <= 0) {
free(member);
_opkg_opk_opk_read_free_inner(opk);
free(path);
return OPKG_OPK_ERROR;
+# pragma GCC diagnostic pop
}
+/* For below #pragmas: fp initialized here
+ * (opk->control_dir != NULL). */
+/* GCC analyzer doesn't complain about this use of path? */
fp = fopen(path, "wb");
if (fp == NULL) {
fputs(_("Error: Failed to extract control file"
"\n"), stderr);
free(member);
_opkg_opk_opk_read_free_inner(opk);
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
free(path);
+# pragma GCC diagnostic pop
return OPKG_OPK_ERROR;
}
}
@@ -235,12 +256,16 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
}
return OPKG_OPK_ERROR;
}
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
if (opk->control_dir != NULL && fwrite(buffer, 1, size,
fp) != size) {
fputs(_("Error: Failed to write control file\n")
, stderr);
_opkg_opk_opk_read_free_inner(opk);
free(path);
+# pragma GCC diagnostic pop
return OPKG_OPK_ERROR;
}
}
@@ -249,25 +274,40 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
stderr);
_opkg_opk_opk_read_free_inner(opk);
if (opk->control_dir != NULL) {
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
free(path);
fclose(fp);
+# pragma GCC diagnostic pop
}
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
return OPKG_OPK_ERROR;
+# pragma GCC diagnostic pop
}
opk->previously_printed = 1;
/* Close file for extraction. */
if (opk->control_dir != NULL) {
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
if (fclose(fp) != 0) {
_opkg_opk_opk_read_free_inner(opk);
free(path);
+# pragma GCC diagnostic pop
return OPKG_OPK_ERROR;
}
}
}
if (opk->control_dir != NULL) {
/* Done with path buffer. */
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
free(path);
+# pragma GCC diagnostic pop
}
if (ret_list == OPKG_OPK_ERROR) {
fputs(_("Error: Failed to list control files\n"), stderr);