Task #91505 - added.err

back to task #91505
download
Error: GCC_ANALYZER_WARNING (CWE-401):
libudfread-1.2.0/src/default_blockinput.c:201:13: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
libudfread-1.2.0/src/default_blockinput.c:193:52: acquire_memory: allocated here
libudfread-1.2.0/src/default_blockinput.c:194:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libudfread-1.2.0/src/default_blockinput.c:201:13: branch_false: ...to here
libudfread-1.2.0/src/default_blockinput.c:201:13: throw: if ‘open’ throws an exception...
libudfread-1.2.0/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.2.0/src/default_blockinput.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
libudfread-1.2.0/src/default_blockinput.c:193:52: acquire_memory: allocated here
libudfread-1.2.0/src/default_blockinput.c:194:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libudfread-1.2.0/src/default_blockinput.c:201:13: branch_false: ...to here
libudfread-1.2.0/src/default_blockinput.c:203:7: branch_false: following ‘false’ branch...
libudfread-1.2.0/src/default_blockinput.c:208:5: branch_false: ...to here
libudfread-1.2.0/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.2.0/src/ecma167.c:366:8: warning[-Wanalyzer-deref-before-check]: check of ‘fe’ for NULL after already dereferencing it
libudfread-1.2.0/src/ecma167.c:347:8: branch_false: following ‘false’ branch...
libudfread-1.2.0/src/ecma167.c:360:8: branch_false: following ‘false’ branch (when ‘num_ad != 0’)...
libudfread-1.2.0/src/ecma167.c:365:100: branch_false: ...to here
libudfread-1.2.0/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.2.0/src/udfread.c:257:14: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
libudfread-1.2.0/src/udfread.c:1434:17: enter_function: entry to ‘_file_open’
libudfread-1.2.0/src/udfread.c:1439:8: branch_false: following ‘false’ branch...
libudfread-1.2.0/src/udfread.c:1444:10: branch_false: ...to here
libudfread-1.2.0/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.2.0/src/udfread.c: scope_hint: In function ‘_read_subdir’
libudfread-1.2.0/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.2.0/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");