Task #131756 - fixed.err
back to task #131756download
Error: GCC_ANALYZER_WARNING (CWE-401):
libselinux-3.10/src/label_media.c:138:28: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)*data.nspec, 80)’
libselinux-3.10/src/label_media.c:70:12: enter_function: entry to ‘init’
libselinux-3.10/src/label_media.c:100:12: branch_true: following ‘true’ branch (when ‘path’ is NULL)...
libselinux-3.10/src/label_media.c:101:24: branch_true: ...to here
libselinux-3.10/src/label_media.c:102:12: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_media.c:104:9: branch_false: ...to here
libselinux-3.10/src/label_media.c:106:12: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_media.c:108:14: branch_false: ...to here
libselinux-3.10/src/label_media.c:108:12: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_media.c:112:26: branch_false: ...to here
libselinux-3.10/src/label_media.c:123:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
libselinux-3.10/src/label_media.c:125:17: branch_true: ...to here
libselinux-3.10/src/label_media.c:126:24: branch_true: following ‘true’ branch...
libselinux-3.10/src/label_media.c:127:24: branch_true: ...to here
libselinux-3.10/src/label_media.c:126:24: branch_true: following ‘true’ branch...
libselinux-3.10/src/label_media.c:128:28: branch_true: ...to here
libselinux-3.10/src/label_media.c:128:29: call_function: calling ‘process_line’ from ‘init’
libselinux-3.10/src/label_media.c:128:29: return_function: returning to ‘init’ from ‘process_line’
libselinux-3.10/src/label_media.c:126:24: branch_true: following ‘true’ branch...
libselinux-3.10/src/label_media.c:127:24: branch_true: ...to here
libselinux-3.10/src/label_media.c:126:24: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_media.c:132:20: branch_false: ...to here
libselinux-3.10/src/label_media.c:132:20: branch_true: following ‘true’ branch (when ‘pass == 0’)...
libselinux-3.10/src/label_media.c:133:29: branch_true: ...to here
libselinux-3.10/src/label_media.c:133:28: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_media.c:137:42: branch_false: ...to here
libselinux-3.10/src/label_media.c:137:42: acquire_memory: allocated here
libselinux-3.10/src/label_media.c:138:28: danger: ‘calloc((long unsigned int)*data.nspec, 80)’ leaks here; was allocated at [(31)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/30)
# 136| }
# 137| data->spec_arr = calloc(data->nspec, sizeof(spec_t));
# 138|-> if (data->spec_arr == NULL)
# 139| goto finish;
# 140| maxnspec = data->nspec;
Error: GCC_ANALYZER_WARNING (CWE-401):
libselinux-3.10/src/label_x.c:165:28: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)*data.nspec, 80)’
libselinux-3.10/src/label_x.c:97:12: enter_function: entry to ‘init’
libselinux-3.10/src/label_x.c:127:12: branch_true: following ‘true’ branch (when ‘path’ is NULL)...
libselinux-3.10/src/label_x.c:128:24: branch_true: ...to here
libselinux-3.10/src/label_x.c:129:12: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_x.c:131:9: branch_false: ...to here
libselinux-3.10/src/label_x.c:133:12: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_x.c:135:14: branch_false: ...to here
libselinux-3.10/src/label_x.c:135:12: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_x.c:139:26: branch_false: ...to here
libselinux-3.10/src/label_x.c:150:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
libselinux-3.10/src/label_x.c:152:17: branch_true: ...to here
libselinux-3.10/src/label_x.c:153:24: branch_true: following ‘true’ branch...
libselinux-3.10/src/label_x.c:154:24: branch_true: ...to here
libselinux-3.10/src/label_x.c:153:24: branch_true: following ‘true’ branch...
libselinux-3.10/src/label_x.c:155:28: branch_true: ...to here
libselinux-3.10/src/label_x.c:155:29: call_function: calling ‘process_line’ from ‘init’
libselinux-3.10/src/label_x.c:155:29: return_function: returning to ‘init’ from ‘process_line’
libselinux-3.10/src/label_x.c:153:24: branch_true: following ‘true’ branch...
libselinux-3.10/src/label_x.c:154:24: branch_true: ...to here
libselinux-3.10/src/label_x.c:153:24: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_x.c:159:20: branch_false: ...to here
libselinux-3.10/src/label_x.c:159:20: branch_true: following ‘true’ branch (when ‘pass == 0’)...
libselinux-3.10/src/label_x.c:160:29: branch_true: ...to here
libselinux-3.10/src/label_x.c:160:28: branch_false: following ‘false’ branch...
libselinux-3.10/src/label_x.c:164:42: branch_false: ...to here
libselinux-3.10/src/label_x.c:164:42: acquire_memory: allocated here
libselinux-3.10/src/label_x.c:165:28: danger: ‘calloc((long unsigned int)*data.nspec, 80)’ leaks here; was allocated at [(31)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/30)
# 163| }
# 164| data->spec_arr = calloc(data->nspec, sizeof(spec_t));
# 165|-> if (data->spec_arr == NULL)
# 166| goto finish;
# 167| maxnspec = data->nspec;
Error: COMPILER_WARNING (CWE-704):
libselinux-3.10/src/selinux_config.c: scope_hint: In function ‘selinux_set_policy_root’
libselinux-3.10/src/selinux_config.c:284:29: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 284 | char *policy_type = strrchr(path, '/');
# | ^~~~~~~
# 282| {
# 283| int i;
# 284|-> char *policy_type = strrchr(path, '/');
# 285| if (!policy_type) {
# 286| errno = EINVAL;
Error: COMPILER_WARNING (CWE-704):
libselinux-3.10/src/selinux_config.c:284:29: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 282| {
# 283| int i;
# 284|-> char *policy_type = strrchr(path, '/');
# 285| if (!policy_type) {
# 286| errno = EINVAL;
Error: GCC_ANALYZER_WARNING (CWE-415):
libselinux-3.10/src/selinux_restorecon.c:183:20: warning[-Wanalyzer-double-free]: double-‘reallocarray’ of ‘exclude_lst’
libselinux-3.10/src/selinux_restorecon.c:1475:6: enter_function: entry to ‘selinux_restorecon_set_exclude_list’
libselinux-3.10/src/selinux_restorecon.c:1480:21: branch_true: following ‘true’ branch...
libselinux-3.10/src/selinux_restorecon.c:1481:21: branch_true: ...to here
libselinux-3.10/src/selinux_restorecon.c:1481:20: branch_true: following ‘true’ branch...
libselinux-3.10/src/selinux_restorecon.c:1481:56: branch_true: ...to here
libselinux-3.10/src/selinux_restorecon.c:1481:21: branch_false: following ‘false’ branch...
libselinux-3.10/src/selinux_restorecon.c:1487:21: branch_false: ...to here
libselinux-3.10/src/selinux_restorecon.c:1487:21: call_function: calling ‘add_exclude’ from ‘selinux_restorecon_set_exclude_list’
libselinux-3.10/src/selinux_restorecon.c:1487:21: return_function: returning to ‘selinux_restorecon_set_exclude_list’ from ‘add_exclude’
libselinux-3.10/src/selinux_restorecon.c:1487:20: branch_true: following ‘true’ branch...
libselinux-3.10/src/selinux_restorecon.c:1488:21: branch_true: ...to here
libselinux-3.10/src/selinux_restorecon.c:1487:21: branch_false: following ‘false’ branch...
libselinux-3.10/src/selinux_restorecon.c:1480:38: branch_false: ...to here
libselinux-3.10/src/selinux_restorecon.c:1480:21: branch_true: following ‘true’ branch...
libselinux-3.10/src/selinux_restorecon.c:1481:21: branch_true: ...to here
libselinux-3.10/src/selinux_restorecon.c:1481:20: branch_true: following ‘true’ branch...
libselinux-3.10/src/selinux_restorecon.c:1481:56: branch_true: ...to here
libselinux-3.10/src/selinux_restorecon.c:1481:21: branch_false: following ‘false’ branch...
libselinux-3.10/src/selinux_restorecon.c:1487:21: branch_false: ...to here
libselinux-3.10/src/selinux_restorecon.c:1487:21: call_function: calling ‘add_exclude’ from ‘selinux_restorecon_set_exclude_list’
# 181| }
# 182|
# 183|-> tmp_list = reallocarray(exclude_lst, exclude_count + 1, sizeof(struct edir));
# 184| if (!tmp_list)
# 185| goto oom;