Error: CPPCHECK_WARNING (CWE-401): [#def1] libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c:173: error[memleak]: Memory leak: base # 171| base->magic = CAP_IAB_MAGIC; # 172| base->size = sizeof(struct _cap_alloc_s); # 173|-> return &base->u.iab; # 174| } # 175| Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c: scope_hint: In function ‘cap_iab_init’ libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c:173:12: warning[-Wanalyzer-malloc-leak]: leak of ‘base’ # 171| base->magic = CAP_IAB_MAGIC; # 172| base->size = sizeof(struct _cap_alloc_s); # 173|-> return &base->u.iab; # 174| } # 175| Error: GCC_ANALYZER_WARNING (CWE-401): [#def3] libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c: scope_hint: In function ‘cap_new_launcher’ libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c:226:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’ # 224| attr->arg0 = arg0; # 225| attr->argv = argv; # 226|-> attr->envp = envp; # 227| return attr; # 228| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c: scope_hint: In function ‘cap_func_launcher’ libcap-2.71-build/libcap-2.71/libcap/cap_alloc.c:248:27: warning[-Wanalyzer-malloc-leak]: leak of ‘data’ # 246| # 247| struct cap_launch_s *attr = &data->u.launcher; # 248|-> attr->custom_setup_fn = callback_fn; # 249| return attr; # 250| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def5] libcap-2.71-build/libcap-2.71/libcap/execable.c:5: included_from: Included from here. libcap-2.71-build/libcap-2.71/libcap/execable.h: scope_hint: In function ‘__execable_parse_args’ libcap-2.71-build/libcap-2.71/libcap/execable.h:38:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/cmdline", "rb")’ # 36| size_t size = 32, offset; # 37| for (offset=0; ; size *= 2) { # 38|-> char *new_mem = realloc(mem, size+1); # 39| if (new_mem == NULL) { # 40| perror("unable to parse arguments"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] libcap-2.71-build/libcap-2.71/libcap/execable.h:38:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/cmdline", "rb")’ # 36| size_t size = 32, offset; # 37| for (offset=0; ; size *= 2) { # 38|-> char *new_mem = realloc(mem, size+1); # 39| if (new_mem == NULL) { # 40| perror("unable to parse arguments"); Error: GCC_ANALYZER_WARNING (CWE-617): [#def7] libcap-2.71-build/libcap-2.71/libcap/execable.h:44:17: warning[-Wanalyzer-tainted-assertion]: use of attacked-controlled value in condition for assertion libcap-2.71-build/libcap-2.71/libcap/execable.c:40:1: note: in expansion of macro ‘SO_MAIN’ libcap-2.71-build/libcap-2.71/libcap/execable.c:40:1: note: in expansion of macro ‘SO_MAIN’ # 42| free(mem); # 43| } # 44|-> exit(1); # 45| } # 46| mem = new_mem; Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] libcap-2.71-build/libcap-2.71/libcap/execable.h:71:1: warning[-Wanalyzer-malloc-leak]: leak of ‘mem’ libcap-2.71-build/libcap-2.71/libcap/execable.c:40:1: note: in expansion of macro ‘SO_MAIN’ libcap-2.71-build/libcap-2.71/libcap/execable.c:40:1: note: in expansion of macro ‘SO_MAIN’ # 69| *argc_p = argc; # 70| *argv_p = argv; # 71|-> } # 72| # 73| /* Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] libcap-2.71-build/libcap-2.71/libcap/execable.h:71:1: warning[-Wanalyzer-malloc-leak]: leak of ‘new_mem’ libcap-2.71-build/libcap-2.71/libcap/execable.c:40:1: note: in expansion of macro ‘SO_MAIN’ libcap-2.71-build/libcap-2.71/libcap/execable.c:40:1: note: in expansion of macro ‘SO_MAIN’ # 69| *argc_p = argc; # 70| *argv_p = argv; # 71|-> } # 72| # 73| /* Error: GCC_ANALYZER_WARNING (CWE-688): [#def10] libcap-2.71-build/libcap-2.71/pam_cap/pam_cap.c: scope_hint: In function ‘read_capabilities_for_user’ libcap-2.71-build/libcap-2.71/pam_cap/pam_cap.c:173:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*<unknown>’ where non-null expected libcap-2.71-build/libcap-2.71/pam_cap/pam_cap.c:30: included_from: Included from here. libcap-2.71-build/libcap-2.71/pam_cap/pam_cap.c:22: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 171| int i; # 172| for (i=0; i < groups_n; i++) { # 173|-> if (!strcmp(groups[i], line+1)) { # 174| D(("user group matched [%s]", line)); # 175| found_one = 1; Error: GCC_ANALYZER_WARNING (CWE-688): [#def11] libcap-2.71-build/libcap-2.71/pam_cap/pam_cap.c: scope_hint: In function ‘set_capabilities’ libcap-2.71-build/libcap-2.71/pam_cap/pam_cap.c:290:10: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘conf_caps’ where non-null expected /usr/include/string.h:33: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 288| # 289| ssize_t conf_caps_length = strlen(conf_caps); # 290|-> if (!strcmp(conf_caps, "all")) { # 291| /* # 292| * all here is interpreted as no change/pass through, which is
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-215.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | libcap-2.71-1.fc42 |
store-results-to | /tmp/tmpma8qqxmx/libcap-2.71-1.fc42.tar.xz |
time-created | 2024-11-13 01:19:45 |
time-finished | 2024-11-13 01:22:19 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpma8qqxmx/libcap-2.71-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpma8qqxmx/libcap-2.71-1.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |