Task #91505 - fixed.err
back to task #91505download
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:34:12: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 32| struct udfread_dirent dirent;
# 33|
# 34|-> while (udfread_readdir(dir, &dirent)) {
# 35| if (!strcmp(dirent.d_name, ".") || !strcmp(dirent.d_name, "..")) continue;
# 36|
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:43:31: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 41| printf("\t\t %s%s\n", path, dirent.d_name);
# 42|
# 43|-> next_dir = (char*)malloc(strlen(path) + strlen(dirent.d_name) + 2);
# 44| if (!next_dir) {
# 45| fprintf(stderr, "out of memory\n");
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:50:21: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 48| sprintf(next_dir, "%s%s/", path, dirent.d_name);
# 49|
# 50|-> child = udfread_opendir_at(dir, dirent.d_name);
# 51| if (!child) {
# 52| fprintf(stderr, "error opening directory %s\n", dirent.d_name);
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:63:18: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 61| UDFFILE *fp;
# 62|
# 63|-> fp = udfread_file_openat(dir, dirent.d_name);
# 64| if (!fp) {
# 65| fprintf(stderr, "error opening file '%s%s'\n", path, dirent.d_name);
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:68:13: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 66| continue;
# 67| }
# 68|-> printf("%16" PRId64 " %s%s\n", udfread_file_size(fp), path, dirent.d_name);
# 69| udfread_file_close(fp);
# 70| }
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:69:13: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 67| }
# 68| printf("%16" PRId64 " %s%s\n", udfread_file_size(fp), path, dirent.d_name);
# 69|-> udfread_file_close(fp);
# 70| }
# 71| }
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/examples/udfls.c:73:12: warning[-Wanalyzer-malloc-leak]: leak of ‘next_dir’
libudfread-1.1.2/examples/udfls.c:76:5: enter_function: entry to ‘main’
libudfread-1.1.2/examples/udfls.c:81:8: branch_false: following ‘false’ branch (when ‘argc > 1’)...
libudfread-1.1.2/examples/udfls.c:87:11: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:88:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:92:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:92:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:98:5: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:101:8: branch_false: following ‘false’ branch...
libudfread-1.1.2/examples/udfls.c:104:9: branch_false: ...to here
libudfread-1.1.2/examples/udfls.c:104:9: call_function: calling ‘_lsdir_at’ from ‘main’
# 71| }
# 72|
# 73|-> return 0;
# 74| }
# 75|
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/src/default_blockinput.c:201:13: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libudfread-1.1.2/src/default_blockinput.c:193:52: acquire_memory: allocated here
libudfread-1.1.2/src/default_blockinput.c:194:8: branch_false: following 'false' branch (when 'p' is non-NULL)...
libudfread-1.1.2/src/default_blockinput.c:201:13: branch_false: ...to here
libudfread-1.1.2/src/default_blockinput.c:201:13: throw: if 'open' throws an exception...
libudfread-1.1.2/src/default_blockinput.c:201:13: danger: 'p' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 199| p->fd = _open_win32(path, O_RDONLY | O_BINARY);
# 200| #else
# 201|-> p->fd = open(path, O_RDONLY);
# 202| #endif
# 203| if(p->fd < 0) {
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/src/default_blockinput.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libudfread-1.1.2/src/default_blockinput.c:193:52: acquire_memory: allocated here
libudfread-1.1.2/src/default_blockinput.c:194:8: branch_false: following 'false' branch (when 'p' is non-NULL)...
libudfread-1.1.2/src/default_blockinput.c:201:13: branch_false: ...to here
libudfread-1.1.2/src/default_blockinput.c:203:7: branch_false: following 'false' branch...
libudfread-1.1.2/src/default_blockinput.c:208:5: branch_false: ...to here
libudfread-1.1.2/src/default_blockinput.c:212:12: danger: 'p' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 210| p->input.size = _def_size;
# 211|
# 212|-> return &p->input;
# 213| }
Error: GCC_ANALYZER_WARNING (CWE-465):
libudfread-1.1.2/src/ecma167.c:366:8: warning[-Wanalyzer-deref-before-check]: check of 'fe' for NULL after already dereferencing it
libudfread-1.1.2/src/ecma167.c:347:8: branch_false: following 'false' branch...
libudfread-1.1.2/src/ecma167.c:360:8: branch_false: following 'false' branch (when 'num_ad != 0')...
libudfread-1.1.2/src/ecma167.c:365:100: branch_false: ...to here
libudfread-1.1.2/src/ecma167.c:366:8: danger: pointer 'fe' is checked for NULL here but it was already dereferenced at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 364|
# 365| fe = (struct file_entry *)realloc(*p_fe, sizeof(struct file_entry) + sizeof(struct long_ad) * (fe->u.ads.num_ad + num_ad));
# 366|-> if (!fe) {
# 367| return -1;
# 368| }
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.1.2/src/udfread.c:257:14: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libudfread-1.1.2/src/udfread.c:1434:17: enter_function: entry to '_file_open'
libudfread-1.1.2/src/udfread.c:1439:8: branch_false: following 'false' branch...
libudfread-1.1.2/src/udfread.c:1444:10: branch_false: ...to here
libudfread-1.1.2/src/udfread.c:1444:10: call_function: calling '_read_file_entry' from '_file_open'
# 255| }
# 256|
# 257|-> result = input->read(input, lba, buf, nblocks, flags);
# 258|
# 259| return result < 0 ? 0 : (uint32_t)result;
Error: COMPILER_WARNING:
libudfread-1.1.2/src/udfread.c: scope_hint: In function '_read_subdir'
libudfread-1.1.2/src/udfread.c:1099:69: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
# 1099 | struct udf_dir **subdirs = (struct udf_dir **)calloc(sizeof(struct udf_dir *), dir->num_entries);
# | ^~~~~~
libudfread-1.1.2/src/udfread.c:1099:69: note: earlier argument should specify number of elements, later size of each element
# 1097|
# 1098| if (!dir->subdirs) {
# 1099|-> struct udf_dir **subdirs = (struct udf_dir **)calloc(sizeof(struct udf_dir *), dir->num_entries);
# 1100| if (!subdirs) {
# 1101| udf_error("out of memory\n");