Error: GCC_ANALYZER_WARNING (CWE-476): [#def1] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch-pam.c: scope_hint: In function 'free_pam_response' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch-pam.c:73:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'resp' # 71| int ii; # 72| for (ii = 0; ii < nresp; ++ii) { # 73|-> if (resp[ii].resp) { # 74| free(resp[ii].resp); # 75| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def2] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch-pam.c: scope_hint: In function 'converse' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch-pam.c:111:40: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'reply' # 109| case PAM_BINARY_PROMPT: # 110| #endif # 111|-> reply[ii].resp = malloc(creds->bv_len + 1); # 112| if (reply[ii].resp != NULL) { # 113| memcpy(reply[ii].resp, creds->bv_val, creds->bv_len); Error: GCC_ANALYZER_WARNING (CWE-476): [#def3] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch-pam.c:120:40: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'reply' # 118| break; # 119| case PAM_PROMPT_ECHO_ON: # 120|-> reply[ii].resp = strdup(conv->user); # 121| if (reply[ii].resp == NULL) { # 122| ret = PAM_CONV_ERR; Error: GCC_ANALYZER_WARNING (CWE-688): [#def4] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch.c: scope_hint: In function 'backend_set_entry_from' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-sch.c:626:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'q' where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 624| p = strchr(rdn, '=') + 1; # 625| i = p - rdn; # 626|-> memcpy(q, rdn, i); # 627| while (*p != '\0') { # 628| j = ((unsigned int) *p++) & 0xff; Error: GCC_ANALYZER_WARNING (CWE-688): [#def5] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c: scope_hint: In function 'backend_shr_get_rel_attr_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:151:41: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*data.rel_attr_list' where non-null expected <built-in>: note: argument 1 of '__builtin_strcpy' must be non-null # 149| strcpy(data->rel_attr_list + length++, ","); # 150| } # 151|-> strcpy(data->rel_attr_list + length, data->rel_attrs[i]); # 152| length += strlen(data->rel_attrs[i]); # 153| } Error: GCC_ANALYZER_WARNING (CWE-131): [#def6] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c: scope_hint: In function 'backend_shr_dup_strlist_n.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:190:15: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size # 188| /* Allocate space for the array of pointers (with NULL terminator) and # 189| * then the string data. */ # 190|-> ret = malloc(((n + 1) * sizeof(char *)) + l); # 191| if (ret != NULL) { # 192| /* Figure out where the string data will start. */ Error: COMPILER_WARNING (CWE-1164): [#def7] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:1056:1: warning[-Wunused-function]: 'backend_shr_get_set_config_entry_cb' defined but not used # 1056 | backend_shr_get_set_config_entry_cb(Slapi_Entry *e, void *callback_data, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 1054| # 1055| static bool_t # 1056|-> backend_shr_get_set_config_entry_cb(Slapi_Entry *e, void *callback_data, # 1057| const char *base_attr, # 1058| const char *filter_attr) Error: GCC_ANALYZER_WARNING (CWE-688): [#def8] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c: scope_hint: In function 'backend_shr_mods_as_string' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:1285:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ret' where non-null expected slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:34: included_from: Included from here. <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 1283| } # 1284| if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) { # 1285|-> strcpy(ret + length, "add:"); # 1286| length += 4; # 1287| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def9] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:1289:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ret' where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 1287| } # 1288| if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) { # 1289|-> strcpy(ret + length, "replace:"); # 1290| length += 8; # 1291| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def10] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:1293:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ret' where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 1291| } # 1292| if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) { # 1293|-> strcpy(ret + length, "delete:"); # 1294| length += 7; # 1295| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def11] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/back-shr.c:1296:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ret' where non-null expected <built-in>: note: argument 1 of '__builtin_strcpy' must be non-null # 1294| length += 7; # 1295| } # 1296|-> strcpy(ret + length, mods[i]->mod_type); # 1297| length += strlen(mods[i]->mod_type); # 1298| } Error: COMPILER_WARNING (CWE-1164): [#def12] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:168:1: warning[-Wunused-function]: 'format_make_sdn_list' defined but not used # 168 | format_make_sdn_list(char **list, struct slapi_dn ***ret, # | ^~~~~~~~~~~~~~~~~~~~ # 166| /* Build a list from string DN values. */ # 167| static struct slapi_dn ** # 168|-> format_make_sdn_list(char **list, struct slapi_dn ***ret, # 169| struct slapi_dn ***ret2) # 170| { Error: COMPILER_WARNING (CWE-1164): [#def13] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:697:1: warning[-Wunused-function]: 'format_count_bv_list' defined but not used # 697 | format_count_bv_list(struct berval **bvlist) # | ^~~~~~~~~~~~~~~~~~~~ # 695| /* Maintain berval lists. */ # 696| static int # 697|-> format_count_bv_list(struct berval **bvlist) # 698| { # 699| int i; Error: COMPILER_WARNING (CWE-1164): [#def14] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:721:1: warning[-Wunused-function]: 'format_dup_bv_list' defined but not used # 721 | format_dup_bv_list(struct berval **bvlist) # | ^~~~~~~~~~~~~~~~~~ # 719| } # 720| static struct berval ** # 721|-> format_dup_bv_list(struct berval **bvlist) # 722| { # 723| struct berval **ret, *bv; Error: GCC_ANALYZER_WARNING (CWE-457): [#def15] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:763:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '<unknown>' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' # 761| if (list != NULL) { # 762| if (i > 0) { # 763|-> memcpy(list, *bvlist, i * sizeof(struct berval *)); # 764| } # 765| list[i] = malloc(sizeof(struct berval)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:771:33: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 769| list[i]->bv_len = bv->bv_len; # 770| list[i + 1] = NULL; # 771|-> free(*bvlist); # 772| *bvlist = list; # 773| } else { Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:774:33: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_add_bv_list.part.0' # 772| *bvlist = list; # 773| } else { # 774|-> free(list[i]); # 775| free(list); # 776| format_free_bv_list(*bvlist); Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c:4095:24: warning[-Wanalyzer-malloc-leak]: leak of 'values' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/format.c: scope_hint: In function 'format_expand_simple' # 4093| expr = strdup(fmt); # 4094| if (expr == NULL) { # 4095|-> return -ENOMEM; # 4096| } # 4097| /* It's a simple expression, so evaluate it. Check for substitutions Error: GCC_ANALYZER_WARNING (CWE-688): [#def19] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c: scope_hint: In function 'map_data_find_domain' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c:163:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'domain_name' where non-null expected slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c:30: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of 'strcmp' must be non-null # 161| int i; # 162| for (i = 0; i < map_data.n_domains; i++) { # 163|-> if (strcmp(domain_name, map_data.domains[i].name) == 0) { # 164| return &map_data.domains[i]; # 165| } Error: COMPILER_WARNING (CWE-1164): [#def20] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c:218:1: warning[-Wunused-function]: 'map_data_find_entry' defined but not used # 218 | map_data_find_entry(struct plugin_state *state, # | ^~~~~~~~~~~~~~~~~~~ # 216| # 217| static struct map_entry * # 218|-> map_data_find_entry(struct plugin_state *state, # 219| const char *domain_name, const char *map_name, # 220| unsigned int key_len, const char *key) Error: GCC_ANALYZER_WARNING (CWE-688): [#def21] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c: scope_hint: In function 'map_data_unset_map' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c:801:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'map_name' where non-null expected /usr/include/string.h:156:12: note: argument 2 of 'strcmp' must be non-null # 799| map = NULL; # 800| for (i = 0; i < domain->n_maps; i++) { # 801|-> if (strcmp(domain->maps[i].name, map_name) == 0) { # 802| map = &domain->maps[i]; # 803| /* Free the individual entries. */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def22] slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c: scope_hint: In function 'map_data_unset_entry' slapi-nis-0.70.0-build/slapi-nis-0.70.0/src/map.c:1020:27: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' # 1018| entry = map_data_find_map_entry_id(state, map, id); # 1019| map_data_unset_map_entry(state, map, entry); # 1020|-> map->last_changed = time(NULL); # 1021| } # 1022| Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] slapi-nis-0.70.0-build/slapi-nis-0.70.0/tests/clients/ldifsort.c: scope_hint: In function ‘main’ slapi-nis-0.70.0-build/slapi-nis-0.70.0/tests/clients/ldifsort.c:74:42: warning[-Wanalyzer-malloc-leak]: leak of ‘entry.dn’ # 72| if (strncasecmp(buf, "dn:", 3) == 0) { # 73| *p = '\0'; # 74|-> entry.dn = strdup(buf); # 75| entry.entry = NULL; # 76| } else {
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-197.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | slapi-nis-0.70.0-3.fc42 |
store-results-to | /tmp/tmplsq1ljh6/slapi-nis-0.70.0-3.fc42.tar.xz |
time-created | 2024-11-13 03:17:13 |
time-finished | 2024-11-13 03:18:42 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmplsq1ljh6/slapi-nis-0.70.0-3.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmplsq1ljh6/slapi-nis-0.70.0-3.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |