Task #1692 - openldap-2.6.7-1.fc40/scan-results.err
back to task #1692download
Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:1636:11: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value # 1634| } # 1635| # 1636|-> if ( err != LDAP_SUCCESS # 1637| || msgbuf[0] # 1638| || ( matched && matched[ 0 ] ) Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2009:5: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 2007| ptr = str; # 2008| ptr = lutil_strncopy( ptr, bv.bv_val, bv.bv_len ); # 2009|-> ptr = lutil_strcopy( ptr, ": " ); # 2010| } # 2011| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2149:4: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 2147| if ( chgpres ) { # 2148| len = snprintf( ptr, blen, " changeNumber %ld", chgnum) ; # 2149|-> ptr += len; # 2150| blen -= len; # 2151| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2150:4: warning[deadcode.DeadStores]: Value stored to 'blen' is never read # 2148| len = snprintf( ptr, blen, " changeNumber %ld", chgnum) ; # 2149| ptr += len; # 2150|-> blen -= len; # 2151| } # 2152| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2153:3: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value # 2151| } # 2152| # 2153|-> tool_write_ldif( ldif ? LDIF_PUT_COMMENT : LDIF_PUT_VALUE, # 2154| ldif ? "persistentSearch: " : "persistentSearch", buf, len ); # 2155| } Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c: scope_hint: In function ‘print_psearch’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2153:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len’ # 2151| } # 2152| # 2153|-> tool_write_ldif( ldif ? LDIF_PUT_COMMENT : LDIF_PUT_VALUE, # 2154| ldif ? "persistentSearch: " : "persistentSearch", buf, len ); # 2155| } Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c: scope_hint: In function ‘print_psearch’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2153:17: warning[-Wmaybe-uninitialized]: ‘len’ may be used uninitialized # 2153 | tool_write_ldif( ldif ? LDIF_PUT_COMMENT : LDIF_PUT_VALUE, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 2154 | ldif ? "persistentSearch: " : "persistentSearch", buf, len ); # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2118:41: note: ‘len’ was declared here # 2118 | int blen = sizeof(buf), len; # | ^~~ # 2151| } # 2152| # 2153|-> tool_write_ldif( ldif ? LDIF_PUT_COMMENT : LDIF_PUT_VALUE, # 2154| ldif ? "persistentSearch: " : "persistentSearch", buf, len ); # 2155| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/common.c:2705:4: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 2703| if ( b64.bv_len ) { # 2704| ptr = lutil_strcopy( ptr, " " ); # 2705|-> ptr = lutil_strcopy( ptr, b64.bv_val ); # 2706| } # 2707| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapcompare.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapcompare.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapcompare.c:217:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘bvalue.bv_val’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 215| if ( *sep != ':' ) { # 216| bvalue.bv_val = strdup( sep ); # 217|-> bvalue.bv_len = strlen( bvalue.bv_val ); # 218| # 219| } else { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapdelete.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapexop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapmodify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapmodrdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldappasswd.c: scope_hint: In function ‘handle_private_option’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldappasswd.c:135:32: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘oldpw.bv_val’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 133| } # 134| } # 135|-> oldpw.bv_len = strlen( oldpw.bv_val ); # 136| break; # 137| Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldappasswd.c:150:32: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘newpw.bv_val’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 148| } # 149| } # 150|-> newpw.bv_len = strlen( newpw.bv_val ); # 151| break; # 152| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c:1262:11: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err' # 1260| } # 1261| # 1262|-> if ( ( err = ldap_put_vrFilter( ber, vrFilter ) ) == -1 ) { # 1263| ber_free( ber, 1 ); # 1264| fprintf( stderr, _("Bad ValuesReturnFilter: %s\n"), vrFilter ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c:1556:11: warning[core.NonNullParamChecker]: Null pointer passed to 3rd parameter expecting 'nonnull' # 1554| rc = 0; # 1555| first = 1; # 1556|-> while ( fgets( line, sizeof( line ), fp ) != NULL ) { # 1557| line[ strlen( line ) - 1 ] = '\0'; # 1558| if ( !first ) { Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c:1556:25: warning[-Wanalyzer-null-argument]: use of NULL ‘fp’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c:41: included_from: Included from here. /usr/include/stdio.h:654:14: note: argument 3 of ‘fgets’ must be non-null # 1554| rc = 0; # 1555| first = 1; # 1556|-> while ( fgets( line, sizeof( line ), fp ) != NULL ) { # 1557| line[ strlen( line ) - 1 ] = '\0'; # 1558| if ( !first ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c:1947:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1945| FILE *tmpfp; # 1946| # 1947|-> rc = ldap_get_dn_ber( ld, entry, &ber, &bv ); # 1948| # 1949| if ( ldif < 2 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapsearch.c:2250:5: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 2248| if ( tag == LDAP_TAG_REFRESHDELETES ) { # 2249| ber_get_boolean( syncinfo, &refreshDeletes ); # 2250|-> tag = ber_peek_tag( syncinfo, &len ); # 2251| } # 2252| if ( refreshDeletes ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapurl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapurl.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapurl.c:290:49: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 288| lud.lud_exts = (char **)realloc( lud.lud_exts, # 289| sizeof( char * ) * ( nexts + 2 ) ); # 290|-> lud.lud_exts[ nexts++ ] = optarg; # 291| lud.lud_exts[ nexts ] = NULL; # 292| break; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:301:31: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘cred.bv_val’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 299| if (argc - optind > 0) { # 300| cred.bv_val = strdup(argv[optind++]); # 301|-> cred.bv_len = strlen(cred.bv_val); # 302| } # 303| if (argc - optind > 0) { Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:318:31: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘cred.bv_val’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:42: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:312:32: note: in expansion of macro ‘getpassphrase’ <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 316| } # 317| cred.bv_val = strdup(userpw); # 318|-> cred.bv_len = strlen(cred.bv_val); # 319| } # 320| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:332:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 330| # 331| if ( dont ) { # 332|-> rc = LDAP_SUCCESS; # 333| goto skip; # 334| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:413:7: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 411| ldap_get_option(ld, LDAP_OPT_DIAGNOSTIC_MESSAGE, (void*) &text); # 412| tool_perror( "ldap_verify_credentials", rc, NULL, NULL, text, NULL ); # 413|-> rc = EXIT_FAILURE; # 414| goto skip; # 415| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:449:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 447| if (rc != LDAP_SUCCESS) { # 448| tool_perror( "ldap_parse_result", rc, NULL, matcheddn, text, refs ); # 449|-> rc = EXIT_FAILURE; # 450| goto skip; # 451| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapvc.c:458:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 456| if (rc != LDAP_SUCCESS) { # 457| tool_perror( "ldap_parse_verify_credentials", rc, NULL, NULL, NULL, NULL ); # 458|-> rc = EXIT_FAILURE; # 459| goto skip; # 460| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapwhoami.c:136:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 134| # 135| if ( dont ) { # 136|-> rc = LDAP_SUCCESS; # 137| goto skip; # 138| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapwhoami.c:146:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 144| if( rc != LDAP_SUCCESS ) { # 145| tool_perror( "ldap_whoami", rc, NULL, NULL, NULL, NULL ); # 146|-> rc = EXIT_FAILURE; # 147| goto skip; # 148| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapwhoami.c:180:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 178| if ( rc != LDAP_SUCCESS ) { # 179| tool_perror( "ldap_parse_result", rc, NULL, matcheddn, text, refs ); # 180|-> rc = EXIT_FAILURE; # 181| goto skip; # 182| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldapwhoami.c:188:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 186| if( rc != LDAP_SUCCESS ) { # 187| tool_perror( "ldap_parse_whoami", rc, NULL, NULL, NULL, NULL ); # 188|-> rc = EXIT_FAILURE; # 189| goto skip; # 190| } Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldcversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/lddversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldeversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldmversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldpversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldrversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldsversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/lduversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldvversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/clients/tools/ldwversion.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/allop/allop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-477): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c: scope_hint: In function ‘nthash’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c:178:9: warning[-Wdeprecated-declarations]: ‘MD4_Init’ is deprecated: Since OpenSSL 3.0 # 178 | MD4_Init( &ctx ); # | ^~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c:71: included_from: Included from here. /usr/include/openssl/md4.h:50:27: note: declared here # 50 | OSSL_DEPRECATEDIN_3_0 int MD4_Init(MD4_CTX *c); # | ^~~~~~~~ # 176| # 177| #ifdef HAVE_OPENSSL # 178|-> MD4_Init( &ctx ); # 179| MD4_Update( &ctx, passwd->bv_val, passwd->bv_len ); # 180| MD4_Final( (unsigned char *)hbuf, &ctx ); Error: COMPILER_WARNING (CWE-477): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c:179:9: warning[-Wdeprecated-declarations]: ‘MD4_Update’ is deprecated: Since OpenSSL 3.0 # 179 | MD4_Update( &ctx, passwd->bv_val, passwd->bv_len ); # | ^~~~~~~~~~ /usr/include/openssl/md4.h:51:27: note: declared here # 51 | OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len); # | ^~~~~~~~~~ # 177| #ifdef HAVE_OPENSSL # 178| MD4_Init( &ctx ); # 179|-> MD4_Update( &ctx, passwd->bv_val, passwd->bv_len ); # 180| MD4_Final( (unsigned char *)hbuf, &ctx ); # 181| #elif defined(HAVE_GNUTLS) Error: COMPILER_WARNING (CWE-477): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c:180:9: warning[-Wdeprecated-declarations]: ‘MD4_Final’ is deprecated: Since OpenSSL 3.0 # 180 | MD4_Final( (unsigned char *)hbuf, &ctx ); # | ^~~~~~~~~ /usr/include/openssl/md4.h:52:27: note: declared here # 52 | OSSL_DEPRECATEDIN_3_0 int MD4_Final(unsigned char *md, MD4_CTX *c); # | ^~~~~~~~~ # 178| MD4_Init( &ctx ); # 179| MD4_Update( &ctx, passwd->bv_val, passwd->bv_len ); # 180|-> MD4_Final( (unsigned char *)hbuf, &ctx ); # 181| #elif defined(HAVE_GNUTLS) # 182| md4_init( &ctx ); Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c: scope_hint: At top level openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/contrib/slapd-modules/smbk5pwd/smbk5pwd.c:624:39: warning[-Wmissing-braces]: missing braces around initializer # 624 | static ConfigTable smbk5pwd_cfats[] = { # | ^ # 622| */ # 623| # 624|-> static ConfigTable smbk5pwd_cfats[] = { # 625| { "smbk5pwd-enable", "arg", # 626| 2, 0, 0, ARG_MAGIC|PC_SMB_ENABLE, smbk5pwd_cf_func, Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/detach.c:36: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/detach.c: scope_hint: In function ‘lutil_detach’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/signal.h:25:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sd’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/detach.c:141:16: note: in expansion of macro ‘SIGNAL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/detach.c:141:16: note: in expansion of macro ‘SIGNAL’ # 23| # 24| #if defined( HAVE_SIGACTION ) # 25|-> #define SIGNAL lutil_sigaction # 26| typedef void (*lutil_sig_t)(int); # 27| LDAP_LUTIL_F(lutil_sig_t) lutil_sigaction( int sig, lutil_sig_t func ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:40: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/signal.h:25:16: warning[-Wmaybe-uninitialized]: ‘sig’ may be used uninitialized # 25 | #define SIGNAL lutil_sigaction openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:79:22: note: ‘sig’ was declared here # 79 | RETSIGTYPE (*sig)( int sig ); # | ^~~ # 23| # 24| #if defined( HAVE_SIGACTION ) # 25|-> #define SIGNAL lutil_sigaction # 26| typedef void (*lutil_sig_t)(int); # 27| LDAP_LUTIL_F(lutil_sig_t) lutil_sigaction( int sig, lutil_sig_t func ); Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:19: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c: scope_hint: In function ‘ber_bvreplace_x’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:77:49: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:86:31: note: in expansion of macro ‘SAFEMEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:711:9: note: in expansion of macro ‘AC_MEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:16: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:705:18: note: in expansion of macro ‘BER_BVISNULL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/lber-int.h:32: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:707:14: note: in expansion of macro ‘BER_BVISNULL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:77:58: note: in definition of macro ‘SAFEMEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:711:9: note: in expansion of macro ‘AC_MEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:86:31: note: in expansion of macro ‘SAFEMEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:711:9: note: in expansion of macro ‘AC_MEMCPY’ <built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null # 75| #ifndef SAFEMEMCPY # 76| # if defined( HAVE_MEMMOVE ) # 77|-> # define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n)) # 78| # elif defined( HAVE_BCOPY ) # 79| # define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n)) Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:77:49: warning[-Wanalyzer-null-argument]: use of NULL ‘*dst.bv_val’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:86:31: note: in expansion of macro ‘SAFEMEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:711:9: note: in expansion of macro ‘AC_MEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:705:18: note: in expansion of macro ‘BER_BVISNULL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:707:14: note: in expansion of macro ‘BER_BVISNULL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/lber-int.h:29: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:235:17: note: in expansion of macro ‘ber_errno’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:86:31: note: in expansion of macro ‘SAFEMEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:711:9: note: in expansion of macro ‘AC_MEMCPY’ <built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null # 75| #ifndef SAFEMEMCPY # 76| # if defined( HAVE_MEMMOVE ) # 77|-> # define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n)) # 78| # elif defined( HAVE_BCOPY ) # 79| # define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n)) Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:42: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c: scope_hint: In function ‘lutil_getpass’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/termios.h:32:48: warning[-Wmaybe-uninitialized]: ‘flags’ may be used uninitialized # 32 | #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags)) # | ~~~~~~~~~~~~~~~^~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:78:23: note: ‘flags’ was declared here # 78 | TERMFLAG_TYPE flags; # | ^~~~~ # 30| #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop)) # 31| #define GETFLAGS( tio ) ((tio).c_lflag) # 32|-> #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags)) # 33| # 34| #elif defined( HAVE_SGTTY_H ) Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap.h:30: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:51: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_del_nonpresent’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lber.h:677:31: warning[-Wanalyzer-null-argument]: use of NULL ‘pdn.bv_val’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4810:38: note: in expansion of macro ‘ber_bvcmp’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4808:25: note: in expansion of macro ‘BER_BVZERO’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lber.h:675:11: note: in definition of macro ‘ber_bvcmp’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4810:38: note: in expansion of macro ‘ber_bvcmp’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4810:38: note: in expansion of macro ‘ber_bvcmp’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4810:38: note: in expansion of macro ‘ber_bvcmp’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:23: included_from: Included from here. /usr/include/string.h:64:12: note: argument 2 of ‘memcmp’ must be non-null # 675| ((v1)->bv_len < (v2)->bv_len \ # 676| ? -1 : ((v1)->bv_len > (v2)->bv_len \ # 677|-> ? 1 : memcmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) )) # 678| # 679| /* Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c: scope_hint: In function ‘ber_bvarray_dup_x’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lber_pvt.h:217:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.bv_val’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:766:22: note: in expansion of macro ‘BER_BVISNULL’ /usr/include/stdio.h:34: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:29: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/lber-int.h:31: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:766:22: note: in expansion of macro ‘BER_BVISNULL’ # 215| (bv)->bv_val = (s); \ # 216| } while (0) # 217|-> #define BER_BVISNULL(bv) ((bv)->bv_val == NULL) # 218| #define BER_BVISEMPTY(bv) ((bv)->bv_len == 0) # 219| Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:49: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:38: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: scope_hint: In function ‘slap_listener’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:159:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘accept(*sl.sl_sd, & from, & len)’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2137:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2137:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2183:15: note: in expansion of macro ‘DAEMON_ID’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2137:9: note: in expansion of macro ‘Debug’ # 157| #define Log(level, severity, ...) \ # 158| do { \ # 159|-> if ( ldap_debug & (level) ) \ # 160| lutil_debug( ldap_debug, (level), __VA_ARGS__ ); \ # 161| if ( ldap_syslog & (level) ) \ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:49: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_message_to_entry’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:160:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘syncUUID’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3424:14: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ # 158| do { \ # 159| if ( ldap_debug & (level) ) \ # 160|-> lutil_debug( ldap_debug, (level), __VA_ARGS__ ); \ # 161| if ( ldap_syslog & (level) ) \ # 162| syslog( LDAP_LEVEL_MASK((severity)), __VA_ARGS__ ); \ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:49: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:29: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c: scope_hint: In function ‘dnssrv_back_referrals’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:160:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘urls’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2756:19: note: in definition of macro ‘_SCM’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2768:68: note: in expansion of macro ‘o_managedsait’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:55:13: note: in expansion of macro ‘get_manageDSAit’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:72:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:160:59: note: in definition of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:160:59: note: in definition of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ # 158| do { \ # 159| if ( ldap_debug & (level) ) \ # 160|-> lutil_debug( ldap_debug, (level), __VA_ARGS__ ); \ # 161| if ( ldap_syslog & (level) ) \ # 162| syslog( LDAP_LEVEL_MASK((severity)), __VA_ARGS__ ); \ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:162:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘syncUUID’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3424:14: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3436:17: note: in expansion of macro ‘Debug’ # 160| lutil_debug( ldap_debug, (level), __VA_ARGS__ ); \ # 161| if ( ldap_syslog & (level) ) \ # 162|-> syslog( LDAP_LEVEL_MASK((severity)), __VA_ARGS__ ); \ # 163| } while ( 0 ) # 164| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:162:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘urls’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2756:19: note: in definition of macro ‘_SCM’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2768:68: note: in expansion of macro ‘o_managedsait’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:55:13: note: in expansion of macro ‘get_manageDSAit’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:72:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:162:62: note: in definition of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:162:62: note: in definition of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:109:9: note: in expansion of macro ‘Debug’ # 160| lutil_debug( ldap_debug, (level), __VA_ARGS__ ); \ # 161| if ( ldap_syslog & (level) ) \ # 162|-> syslog( LDAP_LEVEL_MASK((severity)), __VA_ARGS__ ); \ # 163| } while ( 0 ) # 164| Error: GCC_ANALYZER_WARNING (CWE-131): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:57: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/lload.h:45: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c:25: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c: scope_hint: In function ‘client_init’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_queue.h:533:31: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c:627:5: note: in expansion of macro ‘LDAP_CIRCLEQ_INSERT_TAIL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/lload.h:416:9: note: in expansion of macro ‘checked_lock’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c:603:5: note: in expansion of macro ‘CONNECTION_LOCK’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c:626:5: note: in expansion of macro ‘checked_lock’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c:627:5: note: in expansion of macro ‘LDAP_CIRCLEQ_INSERT_TAIL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c:627:5: note: in expansion of macro ‘LDAP_CIRCLEQ_INSERT_TAIL’ # 531| # 532| #define LDAP_CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ # 533|-> (elm)->field.cqe_next = (void *)(head); \ # 534| (elm)->field.cqe_prev = (head)->cqh_last; \ # 535| if ((head)->cqh_first == (void *)(head)) \ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/bprint.c:220:3: warning[deadcode.DeadStores]: Value stored to 'off' is never read # 218| line[off+1] = hexdig[0x0f & data[i]]; # 219| # 220|-> off = BP_GRAPH + n + ((n >= 8)?1:0); # 221| # 222| if ( isprint( (unsigned char) data[i] )) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/decode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/decode.c: scope_hint: In function ‘ber_get_stringbvl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/decode.c:467:35: warning[-Wmaybe-uninitialized]: ‘res.bo’ may be used uninitialized # 467 | res.bv[n] = bvp; # | ~~~~~~~~~~^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/decode.c:393:11: note: ‘res.bo’ was declared here # 393 | } res; # | ^~~ # 465| goto failed; # 466| } # 467|-> res.bv[n] = bvp; # 468| *bvp = bv; # 469| break; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/encode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/etest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/etest.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/etest.c:143:30: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 141| case 'B': /* bit string */ # 142| buf = getbuf(); # 143|-> rc = ber_printf( ber, fmt, buf, strlen(buf) ); # 144| break; # 145| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/io.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/memory.c:766:8: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 764| for (j=0; j<i; j++) { # 765| ber_dupbv_x( &new[j], &src[j], ctx ); # 766|-> if ( BER_BVISNULL( &new[j] )) { # 767| ber_bvarray_free_x( new, ctx ); # 768| return -1; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/options.c: scope_hint: In function ‘ber_get_option’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/options.c:37:24: warning[-Wunused-but-set-variable]: variable ‘sb’ set but not used # 37 | const Sockbuf *sb; # | ^~ # 35| { # 36| const BerElement *ber; # 37|-> const Sockbuf *sb; # 38| # 39| if(outvalue == NULL) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/options.c:80:2: warning[deadcode.DeadStores]: Value stored to 'sb' is never read # 78| # 79| ber = item; # 80|-> sb = item; # 81| # 82| switch(option) { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/options.c: scope_hint: In function ‘ber_set_option’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/options.c:129:18: warning[-Wunused-but-set-variable]: variable ‘sb’ set but not used # 129 | Sockbuf *sb; # | ^~ # 127| { # 128| BerElement *ber; # 129|-> Sockbuf *sb; # 130| # 131| if(invalue == NULL) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/options.c:197:2: warning[deadcode.DeadStores]: Value stored to 'sb' is never read # 195| # 196| ber = item; # 197|-> sb = item; # 198| # 199| switch(option) { Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblber/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: liblber.la 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/abandon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/abandon.c:212:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 210| struct sockaddr_storage sa = {0}; # 211| /* dummy, filled with ldo_peer in request.c */ # 212|-> err = ber_write( ber, (char *) &sa, sizeof(sa), 0 ); # 213| } # 214| if ( LDAP_IS_UDP(ld) && ld->ld_options.ldo_version == Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/account_usability.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/account_usability.c: scope_hint: In function ‘ldap_parse_accountusability_control’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/account_usability.c:54:15: warning[-Wunused-variable]: unused variable ‘last’ # 54 | char *last; # | ^~~~ # 52| ber_tag_t tag; # 53| ber_len_t berLen; # 54|-> char *last; # 55| # 56| assert( ld != NULL ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/add.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/add.c:84:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 82| return -1; # 83| # 84|-> return msgid; # 85| } # 86| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/add.c:252:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 250| return( rc ); # 251| # 252|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) # 253| return( ld->ld_errno ); # 254| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/apitest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/avl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/avl.c:344:4: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 342| } # 343| /* end case 3 */ # 344|-> p = q; # 345| } # 346| if ( !depth ) Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/charray.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/charray.c: scope_hint: In function ‘ldap_charray2str’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/charray.c:269:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound depends on the length of the source argument # 269 | strncpy( p, *v, len ); # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/charray.c:268:23: note: length computed here # 268 | len = strlen( *v ); # | ^~~~~~~~~~~~ # 267| # 268| len = strlen( *v ); # 269|-> strncpy( p, *v, len ); # 270| p += len; # 271| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/compare.c:154:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 152| bvalue.bv_len = (value == NULL) ? 0 : strlen( value ); # 153| # 154|-> return ldap_compare_ext( ld, dn, attr, &bvalue, NULL, NULL, &msgid ) == LDAP_SUCCESS # 155| ? msgid : -1; # 156| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/compare.c:176:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 174| return( rc ); # 175| # 176|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) # 177| return( ld->ld_errno ); # 178| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/controls.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/controls.c:232:4: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 230| if( tag == LBER_BOOLEAN ) { # 231| ber_int_t crit; # 232|-> tag = ber_scanf( ber, "b", &crit ); # 233| tctrl->ldctl_iscritical = crit ? (char) 0 : (char) ~0; # 234| tag = ber_peek_tag( ber, &len ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/controls.c:238:4: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 236| # 237| if( tag == LBER_OCTETSTRING ) { # 238|-> tag = ber_scanf( ber, "o", &tctrl->ldctl_value ); # 239| } else { # 240| BER_BVZERO( &tctrl->ldctl_value ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/cyrus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/delete.c:139:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 137| return( ld->ld_errno ); # 138| # 139|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) # 140| return( ld->ld_errno ); # 141| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/delete.c:165:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 163| Debug0( LDAP_DEBUG_TRACE, "ldap_delete\n" ); # 164| # 165|-> return ldap_delete_ext( ld, dn, NULL, NULL, &msgid ) == LDAP_SUCCESS # 166| ? msgid : -1 ; # 167| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/deref.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dnssrv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dnssrv.c:318:23: warning[-Wunused-but-set-variable]: variable ‘class’ set but not used # 318 | int type, class, ttl, size; # | ^~~~~ # 316| # 317| while (p < reply + len) { # 318|-> int type, class, ttl, size; # 319| status = dn_expand(reply, reply + len, p, host, sizeof(host)); # 320| if (status < 0) { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dnssrv.c: scope_hint: In function ‘ldap_domain2hostlist’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dnssrv.c:318:30: warning[-Wunused-but-set-variable]: variable ‘ttl’ set but not used # 318 | int type, class, ttl, size; # | ^~~ # 316| # 317| while (p < reply + len) { # 318|-> int type, class, ttl, size; # 319| status = dn_expand(reply, reply + len, p, host, sizeof(host)); # 320| if (status < 0) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dnssrv.c:326:6: warning[deadcode.DeadStores]: Value stored to 'class' is never read # 324| type = (p[0] << 8) | p[1]; # 325| p += 2; # 326|-> class = (p[0] << 8) | p[1]; # 327| p += 2; # 328| ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dnssrv.c:328:6: warning[deadcode.DeadStores]: Value stored to 'ttl' is never read # 326| class = (p[0] << 8) | p[1]; # 327| p += 2; # 328|-> ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; # 329| p += 4; # 330| size = (p[0] << 8) | p[1]; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:105:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 103| # 104| if ( !strcasecmp( s, "V3" ) ) { # 105|-> flags[ i ] |= LDAP_DN_FORMAT_LDAPV3; # 106| } else if ( !strcasecmp( s, "V2" ) ) { # 107| flags[ i ] |= LDAP_DN_FORMAT_LDAPV2; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:107:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 105| flags[ i ] |= LDAP_DN_FORMAT_LDAPV3; # 106| } else if ( !strcasecmp( s, "V2" ) ) { # 107|-> flags[ i ] |= LDAP_DN_FORMAT_LDAPV2; # 108| } else if ( !strcasecmp( s, "DCE" ) ) { # 109| flags[ i ] |= LDAP_DN_FORMAT_DCE; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:109:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 107| flags[ i ] |= LDAP_DN_FORMAT_LDAPV2; # 108| } else if ( !strcasecmp( s, "DCE" ) ) { # 109|-> flags[ i ] |= LDAP_DN_FORMAT_DCE; # 110| } else if ( !strcasecmp( s, "UFN" ) ) { # 111| flags[ i ] |= LDAP_DN_FORMAT_UFN; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:111:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 109| flags[ i ] |= LDAP_DN_FORMAT_DCE; # 110| } else if ( !strcasecmp( s, "UFN" ) ) { # 111|-> flags[ i ] |= LDAP_DN_FORMAT_UFN; # 112| } else if ( !strcasecmp( s, "AD" ) ) { # 113| flags[ i ] |= LDAP_DN_FORMAT_AD_CANONICAL; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:113:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 111| flags[ i ] |= LDAP_DN_FORMAT_UFN; # 112| } else if ( !strcasecmp( s, "AD" ) ) { # 113|-> flags[ i ] |= LDAP_DN_FORMAT_AD_CANONICAL; # 114| } else if ( !strcasecmp( s, "PRETTY" ) ) { # 115| flags[ i ] |= LDAP_DN_PRETTY; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:115:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 113| flags[ i ] |= LDAP_DN_FORMAT_AD_CANONICAL; # 114| } else if ( !strcasecmp( s, "PRETTY" ) ) { # 115|-> flags[ i ] |= LDAP_DN_PRETTY; # 116| } else if ( !strcasecmp( s, "PEDANTIC" ) ) { # 117| flags[ i ] |= LDAP_DN_PEDANTIC; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:117:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 115| flags[ i ] |= LDAP_DN_PRETTY; # 116| } else if ( !strcasecmp( s, "PEDANTIC" ) ) { # 117|-> flags[ i ] |= LDAP_DN_PEDANTIC; # 118| } else if ( !strcasecmp( s, "NOSPACES" ) ) { # 119| flags[ i ] |= LDAP_DN_P_NOLEADTRAILSPACES; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:119:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 117| flags[ i ] |= LDAP_DN_PEDANTIC; # 118| } else if ( !strcasecmp( s, "NOSPACES" ) ) { # 119|-> flags[ i ] |= LDAP_DN_P_NOLEADTRAILSPACES; # 120| } else if ( !strcasecmp( s, "NOONESPACE" ) ) { # 121| flags[ i ] |= LDAP_DN_P_NOSPACEAFTERRDN; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/dntest.c:121:17: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage # 119| flags[ i ] |= LDAP_DN_P_NOLEADTRAILSPACES; # 120| } else if ( !strcasecmp( s, "NOONESPACE" ) ) { # 121|-> flags[ i ] |= LDAP_DN_P_NOSPACEAFTERRDN; # 122| } # 123| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/error.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/extended.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/extended.c:159:10: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 157| } # 158| # 159|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) { # 160| return( ld->ld_errno ); # 161| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ftest.c:83:2: warning[unix.Malloc]: Potential memory leak # 81| } # 82| # 83|-> return filter2ber( strdup( argv[optind] ) ); # 84| } # 85| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/getdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/getdn.c:2151:4: warning[deadcode.DeadStores]: Value stored to 'cl' is never read # 2149| */ # 2150| if ( val->bv_val[ s ] == '\0' ) { # 2151|-> cl = 1; # 2152| str[ d++ ] = '\\'; # 2153| str[ d++ ] = '0'; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/getvalues.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/init.c:39:9: warning[-Wmissing-braces]: missing braces around initializer # 39 | { LDAP_UNINITIALIZED, LDAP_DEBUG_NONE # | ^ # 37| # 38| struct ldapoptions ldap_int_global_options = # 39|-> { LDAP_UNINITIALIZED, LDAP_DEBUG_NONE # 40| LDAP_LDO_NULLARG # 41| LDAP_LDO_SOURCEIP_NULLARG Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/init.c: scope_hint: In function ‘ldap_pvt_conf_option’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/init.c:264:13: warning[-Wunused-variable]: unused variable ‘rc’ # 264 | int rc = LDAP_OPT_ERROR; # | ^~ # 262| { # 263| struct ldapoptions *gopts; # 264|-> int rc = LDAP_OPT_ERROR; # 265| # 266| /* Get pointer to global option structure */ Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/init.c: scope_hint: In function ‘openldap_ldap_init_w_conf’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/init.c:286:13: warning[-Wunused-variable]: unused variable ‘i’ # 286 | int i; # | ^ # 284| char linebuf[ AC_LINE_MAX ]; # 285| FILE *fp; # 286|-> int i; # 287| char *cmd, *opt; # 288| char *start, *end; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap_sync.c:145:2: warning[deadcode.DeadStores]: Value stored to 'phase' is never read # 143| assert( res != NULL ); # 144| # 145|-> phase = ls->ls_refreshPhase; # 146| # 147| /* OK */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap_sync.c:790:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 788| switch ( ldap_msgtype( msg ) ) { # 789| case LDAP_RES_SEARCH_ENTRY: # 790|-> rc = ldap_sync_search_entry( ls, res ); # 791| break; # 792| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap_sync.c:794:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 792| # 793| case LDAP_RES_SEARCH_REFERENCE: # 794|-> rc = ldap_sync_search_reference( ls, res ); # 795| break; # 796| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldif.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldif.c:165:9: warning[deadcode.DeadStores]: Value stored to 'byte' during its initialization is never read # 163| # 164| if ( b64 ) { # 165|-> char *byte = s; # 166| # 167| if ( *s == '\0' ) { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldif.c: scope_hint: In function ‘ldif_parse_line2’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldif.c:165:23: warning[-Wunused-variable]: unused variable ‘byte’ # 165 | char *byte = s; # | ^~~~ # 163| # 164| if ( b64 ) { # 165|-> char *byte = s; # 166| # 167| if ( *s == '\0' ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:59:45: warning[-Wanalyzer-null-argument]: use of NULL ‘<unknown>’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:417:31: note: in expansion of macro ‘BV_CASEMATCH’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:59:11: note: in definition of macro ‘BV_CASEMATCH’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:417:31: note: in expansion of macro ‘BV_CASEMATCH’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:417:31: note: in expansion of macro ‘BV_CASEMATCH’ /usr/include/string.h:462: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:29: included_from: Included from here. /usr/include/strings.h:116:12: note: argument 2 of ‘strcasecmp’ must be non-null # 57| # 58| #define BV_CASEMATCH(a, b) \ # 59|-> ((a)->bv_len == (b)->bv_len && 0 == strcasecmp((a)->bv_val, (b)->bv_val)) # 60| # 61| static int parse_ldif_control LDAP_P(( struct berval *bval, LDAPControl ***ppctrls )); Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c: scope_hint: In function ‘ldap_parse_ldif_record_x’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:215:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘idn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:23: included_from: Included from here. # 213| i = 0; # 214| } else { # 215|-> i = idn+1; # 216| /* Check for "control" tag after dn and before changetype. */ # 217| if ( BV_CASEMATCH( lr->lr_btype+i, &BV_CONTROL )) { Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c: scope_hint: In function ‘ldap_parse_ldif_record_x’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:215:19: warning[-Wmaybe-uninitialized]: ‘idn’ may be used uninitialized # 215 | i = idn+1; # | ~~^~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:116:22: note: ‘idn’ was declared here # 116 | int i, j, k, idn, nmods; # | ^~~ # 213| i = 0; # 214| } else { # 215|-> i = idn+1; # 216| /* Check for "control" tag after dn and before changetype. */ # 217| if ( BV_CASEMATCH( lr->lr_btype+i, &BV_CONTROL )) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:217:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 215| i = idn+1; # 216| /* Check for "control" tag after dn and before changetype. */ # 217|-> if ( BV_CASEMATCH( lr->lr_btype+i, &BV_CONTROL )) { # 218| /* Parse and add it to the list of controls */ # 219| if ( !( flags & LDIF_NO_CONTROLS ) ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:241:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 239| # 240| /* Check for changetype */ # 241|-> if ( BV_CASEMATCH( lr->lr_btype+i, &BV_CHANGETYPE )) { # 242| #ifdef LIBERAL_CHANGETYPE_MODOP # 243| /* trim trailing spaces (and log warning ...) */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:411:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 409| BER_BVZERO(&bv); # 410| for (i=idn; i<lr->lr_lines; i++) { # 411|-> if ( BV_CASEMATCH( lr->lr_btype+i, &BV_DN )) { # 412| fprintf( stderr, _("%s: attributeDescription \"%s\":" # 413| " (possible missing newline" Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:417:10: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 415| errstr, lr->lr_btype[i].bv_val, linenum+i - 1, dn ); # 416| } # 417|-> if ( !BV_CASEMATCH( lr->lr_btype+i, &bv )) { # 418| bvl[k++] = NULL; # 419| bv = lr->lr_btype[i]; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:417:10: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 415| errstr, lr->lr_btype[i].bv_val, linenum+i - 1, dn ); # 416| } # 417|-> if ( !BV_CASEMATCH( lr->lr_btype+i, &bv )) { # 418| bvl[k++] = NULL; # 419| bv = lr->lr_btype[i]; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:462:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 460| expect_modop = 0; # 461| expect_sep = 1; # 462|-> if ( BV_CASEMATCH( lr->lr_btype+i, &BV_MODOPADD )) { # 463| modop = LDAP_MOD_ADD; # 464| lr->lr_mops[i] = M_SEP; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:466:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 464| lr->lr_mops[i] = M_SEP; # 465| nmods--; # 466|-> } else if ( BV_CASEMATCH( lr->lr_btype+i, &BV_MODOPREPLACE )) { # 467| /* defer handling these since they might have no values. # 468| * Use the BVALUES flag to signal that these were Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:475:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 473| lr->lr_mops[i] = modop | LDAP_MOD_BVALUES; # 474| lr->lr_btype[i] = lr->lr_vals[i]; # 475|-> } else if ( BV_CASEMATCH( lr->lr_btype+i, &BV_MODOPDELETE )) { # 476| modop = LDAP_MOD_DELETE; # 477| lr->lr_mops[i] = modop | LDAP_MOD_BVALUES; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:479:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 477| lr->lr_mops[i] = modop | LDAP_MOD_BVALUES; # 478| lr->lr_btype[i] = lr->lr_vals[i]; # 479|-> } else if ( BV_CASEMATCH( lr->lr_btype+i, &BV_MODOPINCREMENT )) { # 480| modop = LDAP_MOD_INCREMENT; # 481| lr->lr_mops[i] = M_SEP; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:540:47: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 538| if ( lr->lr_mops[i] == M_SEP ) # 539| continue; # 540|-> if ( lr->lr_mops[i] != lr->lr_mops[i-1] || !BV_CASEMATCH( lr->lr_btype+i, &bv )) { # 541| bvl[k++] = NULL; # 542| bv = lr->lr_btype[i]; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c: scope_hint: In function ‘parse_ldif_control’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldifutil.c:709:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ppctrls’ # 707| newctrl = NULL; # 708| pctrls[i+1] = NULL; # 709|-> *ppctrls = pctrls; # 710| # 711| cleanup: Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/modify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/modify.c:206:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 204| return -1; # 205| # 206|-> return msgid; # 207| } # 208| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/modify.c:222:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 220| return( rc ); # 221| # 222|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) # 223| return( ld->ld_errno ); # 224| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/modrdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/modrdn.c:189:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 187| deleteoldrdn, NULL, NULL, &msgid ); # 188| # 189|-> return rc == LDAP_SUCCESS ? msgid : -1; # 190| } # 191| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/modrdn.c:241:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 239| } # 240| # 241|-> rc = ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &res ); # 242| # 243| if( rc == -1 || !res ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/msctrl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/msctrl.c: scope_hint: In function ‘ldap_parse_dirsync_control’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/msctrl.c:125:25: warning[-Wunused-variable]: unused variable ‘len’ # 125 | ber_len_t len; # | ^~~ # 123| BerElement *ber; # 124| ber_tag_t tag; # 125|-> ber_len_t len; # 126| int unused; # 127| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/open.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/options.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/options.c:621:10: warning[core.NullDereference]: Access to field 'ldc' results in a dereference of a null pointer (loaded from variable 'ld') # 619| rc = LDAP_OPT_SUCCESS; # 620| if( source_ip == NULL ) { # 621|-> if ( ld->ld_options.ldo_local_ip_addrs.local_ip_addrs ) { # 622| LDAP_FREE( ld->ld_options.ldo_local_ip_addrs.local_ip_addrs ); # 623| memset( &ld->ld_options.ldo_local_ip_addrs, 0, Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-ip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-666): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-ip.c: scope_hint: In function ‘ldap_pvt_connect’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-ip.c:450:22: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘s’ in wrong phase openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-ip.c:43: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap-int.h:84:11: note: in expansion of macro ‘ldap_debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap-int.h:102:19: note: in expansion of macro ‘DebugTest’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-ip.c:441:9: note: in expansion of macro ‘Debug3’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-ip.c:441:9: note: in expansion of macro ‘Debug3’ # 448| do{ # 449| Debug0(LDAP_DEBUG_TRACE, "attempting to connect: \n" ); # 450|-> if ( connect(s, sin, addrlen) != AC_SOCKET_ERROR ) { # 451| Debug0(LDAP_DEBUG_TRACE, "connect success\n" ); # 452| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-local.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-252): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-local.c: scope_hint: In function ‘ldap_pvt_is_socket_ready’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/os-local.c:139:23: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ # 139 | (void)read(s, &ch, 1); # | ^~~~~~~~~~~~~~~ # 137| { # 138| /* XXX: needs to be replace with ber_stream_read() */ # 139|-> (void)read(s, &ch, 1); # 140| TRACE; # 141| return -1; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/pagectrl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/passwd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/psearchctrl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/psearchctrl.c: scope_hint: In function ‘ldap_create_persistentsearch_control_value’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/psearchctrl.c:80:25: warning[-Wunused-variable]: unused variable ‘i’ # 80 | int i; # | ^ # 78| struct berval *value ) # 79| { # 80|-> int i; # 81| BerElement *ber = NULL; # 82| ber_tag_t tag; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/psearchctrl.c: scope_hint: In function ‘ldap_parse_entrychange_control’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/psearchctrl.c:259:24: warning[-Wunused-variable]: unused variable ‘berTag’ # 259 | ber_tag_t tag, berTag; # | ^~~~~~ # 257| { # 258| BerElement *ber; # 259|-> ber_tag_t tag, berTag; # 260| ber_len_t berLen; # 261| ber_int_t chgtype; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/request.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/request.c: scope_hint: In function ‘ldap_send_server_request’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/request.c:387:38: warning[-Wunused-but-set-variable]: variable ‘rtag’ set but not used # 387 | ber_tag_t tag, rtag; # | ^~~~ # 385| BerElement tmpber = *ber; # 386| ber_int_t bint; # 387|-> ber_tag_t tag, rtag; # 388| # 389| ber_reset( &tmpber, 1 ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/request.c:390:3: warning[deadcode.DeadStores]: Value stored to 'rtag' is never read # 388| # 389| ber_reset( &tmpber, 1 ); # 390|-> rtag = ber_scanf( &tmpber, "{it", /*}*/ &bint, &tag ); # 391| switch ( tag ) { # 392| case LDAP_REQ_BIND: Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/request.c:393:4: warning[deadcode.DeadStores]: Value stored to 'rtag' is never read # 391| switch ( tag ) { # 392| case LDAP_REQ_BIND: # 393|-> rtag = ber_scanf( &tmpber, "{i" /*}*/, &bint ); # 394| break; # 395| case LDAP_REQ_DELETE: Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/request.c:398:4: warning[deadcode.DeadStores]: Value stored to 'rtag' is never read # 396| break; # 397| default: # 398|-> rtag = ber_scanf( &tmpber, "{" /*}*/ ); # 399| case LDAP_REQ_ABANDON: # 400| break; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c: scope_hint: In function ‘try_read1msg’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:662:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘lr’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:53: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:65: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap-int.h:84:11: note: in expansion of macro ‘ldap_debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap-int.h:102:19: note: in expansion of macro ‘DebugTest’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:473:9: note: in expansion of macro ‘Debug3’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/errno.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:59: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:489:9: note: in expansion of macro ‘sock_errset’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap-int.h:84:11: note: in expansion of macro ‘ldap_debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/ldap-int.h:102:19: note: in expansion of macro ‘DebugTest’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:620:9: note: in expansion of macro ‘Debug3’ # 660| } # 661| # 662|-> id = lr->lr_origid; # 663| refer_cnt = 0; # 664| hadref = simple_request = 0; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:662:16: warning[-Wmaybe-uninitialized]: ‘lr’ may be used uninitialized # 662 | id = lr->lr_origid; # | ~~^~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c: scope_hint: In function ‘wait4msg’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/result.c:456:26: note: ‘lr’ was declared here # 456 | LDAPRequest *lr, *tmplr, dummy_lr = { 0 }; # | ^~ # 660| } # 661| # 662|-> id = lr->lr_origid; # 663| refer_cnt = 0; # 664| hadref = simple_request = 0; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/rq.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:210:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 208| #endif # 209| # 210|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 || !result ) { # 211| return( ld->ld_errno ); /* ldap_result sets ld_errno */ # 212| } Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c: scope_hint: In function ‘ldap_sasl_bind_s’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:210:14: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘msgid’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:35: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:152:17: note: in expansion of macro ‘LDAP_VALID’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:45: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:205:13: note: in expansion of macro ‘LDAP_IS_UDP’ # 208| #endif # 209| # 210|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 || !result ) { # 211| return( ld->ld_errno ); /* ldap_result sets ld_errno */ # 212| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:536:8: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 534| #endif # 535| # 536|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 || !result ) { # 537| return( ld->ld_errno ); /* ldap_result sets ld_errno */ # 538| } Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c: scope_hint: In function ‘ldap_sasl_interactive_bind_s’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:536:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘msgid’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sasl.c:531:21: note: in expansion of macro ‘LDAP_IS_UDP’ # 534| #endif # 535| # 536|-> if ( ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &result ) == -1 || !result ) { # 537| return( ld->ld_errno ); /* ldap_result sets ld_errno */ # 538| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c: scope_hint: In function ‘append_to_safe_string.isra.0’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:191:9: warning[-Wstringop-truncation]: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length # 191 | strncpy(&ss->val[ss->pos], s, l); # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:166:17: note: length computed here # 166 | int l = strlen(s); # | ^~~~~~~~~ # 189| ss->val = temp; # 190| } # 191|-> strncpy(&ss->val[ss->pos], s, l); # 192| ss->pos += l; # 193| if ( ss->pos > 0 && LDAP_SPACE(ss->val[ss->pos-1]) ) Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:2280:5: warning[deadcode.DeadStores]: Value stored to 'savepos' is never read # 2278| seen_syntax = 1; # 2279| parse_whsp(&ss); # 2280|-> savepos = ss; # 2281| at->at_syntax_oid = # 2282| parse_noidlen(&ss, Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c: scope_hint: In function ‘ldap_str2structurerule’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:3000:22: warning[-Wunused-but-set-variable]: variable ‘savepos’ set but not used # 3000 | const char * savepos; # | ^~~~~~~ # 2998| LDAPStructureRule * sr; # 2999| char ** ext_vals; # 3000|-> const char * savepos; # 3001| # 3002| if ( !s ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:3028:2: warning[deadcode.DeadStores]: Value stored to 'savepos' is never read # 3026| */ # 3027| parse_whsp(&ss); # 3028|-> savepos = ss; # 3029| ret = ldap_int_parse_ruleid(&ss,code,0,&sr->sr_ruleid); # 3030| if ( ret ) { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c: scope_hint: In function ‘ldap_str2nameform’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:3186:22: warning[-Wunused-but-set-variable]: variable ‘savepos’ set but not used # 3186 | const char * savepos; # | ^~~~~~~ # 3184| LDAPNameForm * nf; # 3185| char ** ext_vals; # 3186|-> const char * savepos; # 3187| # 3188| if ( !s ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/schema.c:3218:2: warning[deadcode.DeadStores]: Value stored to 'savepos' is never read # 3216| */ # 3217| parse_whsp(&ss); # 3218|-> savepos = ss; # 3219| nf->nf_oid = ldap_int_parse_numericoid(&ss,code,0); # 3220| if ( !nf->nf_oid ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/search.c:181:7: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 179| } # 180| # 181|-> rc = ldap_result( ld, msgid, LDAP_MSG_ALL, timeout, res ); # 182| # 183| if( rc <= 0 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/search.c:310:6: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 308| struct sockaddr_storage sa = {0}; # 309| /* dummy, filled with ldo_peer in request.c */ # 310|-> err = ber_write( ber, (char *) &sa, sizeof( sa ), 0 ); # 311| } # 312| if ( LDAP_IS_UDP(ld) && ld->ld_options.ldo_version == LDAP_VERSION2) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sort.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/sortctrl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:217:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 215| # 216| if ( len == 0 ) { # 217|-> tag = ber_skip_tag( ber, &len ); # 218| # 219| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:224:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 222| * but we're liberal in what we accept */ # 223| } # 224|-> tag = ber_scanf( ber, "o", ip ); # 225| } # 226| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:235:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 233| # 234| if ( len == 0 ) { # 235|-> tag = ber_skip_tag( ber, &len ); # 236| # 237| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:242:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 240| * but we're liberal in what we accept */ # 241| } # 242|-> tag = ber_scanf( ber, "o", name ); # 243| } # 244| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:261:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 259| * but we're liberal in what we accept */ # 260| } # 261|-> tag = ber_scanf( ber, "o", oid ); # 262| } # 263| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:274:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 272| # 273| if ( len == 0 ) { # 274|-> tag = ber_skip_tag( ber, &len ); # 275| # 276| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/stctrl.c:283:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 281| } # 282| #endif # 283|-> tag = ber_scanf( ber, "o", id ); # 284| } # 285| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tavl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tavl.c:410:4: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 408| } # 409| /* end case 3 */ # 410|-> p = q; # 411| } # 412| if ( !depth ) Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: scope_hint: In function ‘get_modlist’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:82:17: warning[-Wanalyzer-malloc-leak]: leak of ‘get_list(prompt3)’ # 80| result = (char **) 0; # 81| while ( 1 ) { # 82|-> get_line( buf, sizeof(buf), stdin, prompt ); # 83| # 84| if ( *buf == '\0' ) Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:82:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(&buf)’ # 80| result = (char **) 0; # 81| while ( 1 ) { # 82|-> get_line( buf, sizeof(buf), stdin, prompt ); # 83| # 84| if ( *buf == '\0' ) Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: scope_hint: In function ‘get_list’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:88:44: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ # 86| # 87| if ( result == (char **) 0 ) # 88|-> result = (char **) malloc( sizeof(char *) ); # 89| else # 90| result = (char **) realloc( result, Error: CPPCHECK_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:90: error[memleakOnRealloc]: Common realloc mistake: 'result' nulled but not freed upon failure # 88| result = (char **) malloc( sizeof(char *) ); # 89| else # 90|-> result = (char **) realloc( result, # 91| sizeof(char *) * (num + 1) ); # 92| Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:90:44: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 88| result = (char **) malloc( sizeof(char *) ); # 89| else # 90|-> result = (char **) realloc( result, # 91| sizeof(char *) * (num + 1) ); # 92| Error: GCC_ANALYZER_WARNING (CWE-122): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:93:31: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:93:31: note: write of 8 bytes to beyond the end of the region # 91| sizeof(char *) * (num + 1) ); # 92| # 93|-> result[num++] = (char *) strdup( buf ); # 94| } # 95| if ( result == (char **) 0 ) Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:93:31: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 91| sizeof(char *) * (num + 1) ); # 92| # 93|-> result[num++] = (char *) strdup( buf ); # 94| } # 95| if ( result == (char **) 0 ) Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:95:12: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ # 93| result[num++] = (char *) strdup( buf ); # 94| } # 95|-> if ( result == (char **) 0 ) # 96| return( NULL ); # 97| result = (char **) realloc( result, sizeof(char *) * (num + 1) ); Error: CPPCHECK_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:97: error[memleakOnRealloc]: Common realloc mistake: 'result' nulled but not freed upon failure # 95| if ( result == (char **) 0 ) # 96| return( NULL ); # 97|-> result = (char **) realloc( result, sizeof(char *) * (num + 1) ); # 98| result[num] = NULL; # 99| Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:98:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 96| return( NULL ); # 97| result = (char **) realloc( result, sizeof(char *) * (num + 1) ); # 98|-> result[num] = NULL; # 99| # 100| return( result ); Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:98:21: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ # 96| return( NULL ); # 97| result = (char **) realloc( result, sizeof(char *) * (num + 1) ); # 98|-> result[num] = NULL; # 99| # 100| return( result ); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: scope_hint: In function ‘file_read’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:123:25: warning[-Wunused-but-set-variable]: variable ‘eof’ set but not used # 123 | int eof; # | ^~~ # 121| FILE *fp; # 122| ber_slen_t rlen; # 123|-> int eof; # 124| # 125| if (( fp = fopen( path, "r" )) == NULL ) { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: scope_hint: In function ‘file_read’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:136:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bv’ # 134| } # 135| # 136|-> bv->bv_len = ftell( fp ); # 137| # 138| if (( bv->bv_val = (char *)malloc( bv->bv_len )) == NULL ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:151:2: warning[deadcode.DeadStores]: Value stored to 'eof' is never read # 149| # 150| rlen = fread( bv->bv_val, 1, bv->bv_len, fp ); # 151|-> eof = feof( fp ); # 152| fclose( fp ); # 153| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: scope_hint: In function ‘get_modlist’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:197:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’ # 195| int i; # 196| # 197|-> for ( i = 0; tmp.mod_values[i] != NULL; ++i ) # 198| ; # 199| bvals = (struct berval **)calloc( i + 1, Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:201:56: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 199| bvals = (struct berval **)calloc( i + 1, # 200| sizeof( struct berval *)); # 201|-> for ( i = 0; tmp.mod_values[i] != NULL; ++i ) { # 202| bvals[i] = (struct berval *)malloc( # 203| sizeof( struct berval )); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:202:42: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bvals’ # 200| sizeof( struct berval *)); # 201| for ( i = 0; tmp.mod_values[i] != NULL; ++i ) { # 202|-> bvals[i] = (struct berval *)malloc( # 203| sizeof( struct berval )); # 204| if ( strncmp( tmp.mod_values[i], "{FILE}", Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:206:44: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 204| if ( strncmp( tmp.mod_values[i], "{FILE}", # 205| 6 ) == 0 ) { # 206|-> if ( file_read( tmp.mod_values[i] + 6, # 207| bvals[i] ) < 0 ) { # 208| free( bvals ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:208:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp.mod_type' # 206| if ( file_read( tmp.mod_values[i] + 6, # 207| bvals[i] ) < 0 ) { # 208|-> free( bvals ); # 209| for ( i = 0; i<num; i++ ) # 210| free( result[ i ] ); Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:208:49: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 206| if ( file_read( tmp.mod_values[i] + 6, # 207| bvals[i] ) < 0 ) { # 208|-> free( bvals ); # 209| for ( i = 0; i<num; i++ ) # 210| free( result[ i ] ); Error: CPPCHECK_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:212: error[memleak]: Memory leak: tmp.mod_type # 210| free( result[ i ] ); # 211| free( result ); # 212|-> return( NULL ); # 213| } # 214| } else { Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:212:55: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ # 210| free( result[ i ] ); # 211| free( result ); # 212|-> return( NULL ); # 213| } # 214| } else { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:215:58: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(16)’ # 213| } # 214| } else { # 215|-> bvals[i]->bv_val = tmp.mod_values[i]; # 216| bvals[i]->bv_len = # 217| strlen( tmp.mod_values[i] ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:221:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp.mod_vals.modv_strvals' # 219| } # 220| tmp.mod_bvalues = bvals; # 221|-> tmp.mod_op |= LDAP_MOD_BVALUES; # 222| } # 223| Error: CPPCHECK_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:227: error[memleakOnRealloc]: Common realloc mistake: 'result' nulled but not freed upon failure # 225| result = (LDAPMod **) malloc( sizeof(LDAPMod *) ); # 226| else # 227|-> result = (LDAPMod **) realloc( result, # 228| sizeof(LDAPMod *) * (num + 1) ); # 229| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:230:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 228| sizeof(LDAPMod *) * (num + 1) ); # 229| # 230|-> result[num] = (LDAPMod *) malloc( sizeof(LDAPMod) ); # 231| *(result[num]) = tmp; /* struct copy */ # 232| num++; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:231:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(24)’ # 229| # 230| result[num] = (LDAPMod *) malloc( sizeof(LDAPMod) ); # 231|-> *(result[num]) = tmp; /* struct copy */ # 232| num++; # 233| } Error: CPPCHECK_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:236: error[memleakOnRealloc]: Common realloc mistake: 'result' nulled but not freed upon failure # 234| if ( result == NULL ) # 235| return( NULL ); # 236|-> result = (LDAPMod **) realloc( result, sizeof(LDAPMod *) * (num + 1) ); # 237| result[num] = NULL; # 238| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:282:25: warning[-Wunused-but-set-variable]: variable ‘bound’ set but not used # 282 | int bound, all, scope, attrsonly; # | ^~~~~ # 280| static const char usage[] = # 281| "usage: %s [-u] [-h host] [-d level] [-s dnsuffix] [-p port] [-t file] [-T file]\n"; # 282|-> int bound, all, scope, attrsonly; # 283| LDAPMessage *res; # 284| LDAPMod **mods, **attrs; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:366:2: warning[deadcode.DeadStores]: Value stored to 'bound' is never read # 364| } # 365| # 366|-> bound = 0; # 367| timeout.tv_sec = 0; # 368| timeout.tv_usec = 0; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:421:5: warning[deadcode.DeadStores]: Value stored to 'bound' is never read # 419| } else { # 420| printf( "Bind initiated\n" ); # 421|-> bound = 1; # 422| } # 423| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/test.c:442:5: warning[deadcode.DeadStores]: Value stored to 'bound' is never read # 440| } else { # 441| printf( "Bind successful\n" ); # 442|-> bound = 1; # 443| } # 444| break; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/threads.c: scope_hint: In function ‘ldap_pvt_thread_initialize’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/threads.c:45:27: warning[-Wunused-but-set-variable]: variable ‘tid’ set but not used # 45 | ldap_pvt_thread_t tid; # | ^~~ # 43| int rc; # 44| static int init = 0; # 45|-> ldap_pvt_thread_t tid; # 46| # 47| /* we only get one shot at this */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/threads.c:59:2: warning[deadcode.DeadStores]: Value stored to 'tid' is never read # 57| # 58| /* kludge to pull symbol definitions in */ # 59|-> tid = ldap_pvt_thread_self(); # 60| return 0; # 61| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c: scope_hint: In function ‘ldap_int_tls_start’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c:1123:15: warning[-Wunused-variable]: unused variable ‘ssl’ # 1123 | void *ssl; # | ^~~ # 1121| Sockbuf *sb; # 1122| char *host; # 1123|-> void *ssl; # 1124| int ret, async; # 1125| struct timeval start_time_tv, tv, tv0; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c:1195:42: warning[core.UndefinedBinaryOperatorResult]: The right operand of '-' is a garbage value # 1193| # 1194| /* delta = curr - start */ # 1195|-> delta_tv.tv_sec = curr_time_tv.tv_sec - start_time_tv.tv_sec; # 1196| delta_tv.tv_usec = curr_time_tv.tv_usec - start_time_tv.tv_usec; # 1197| if ( delta_tv.tv_usec < 0 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c:1542:4: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1540| if ( rdn_end > dn_end ) # 1541| return LDAP_DECODING_ERROR; # 1542|-> tag = ber_skip_tag( ber, &len ); # 1543| ber_skip_data( ber, len ); # 1544| navas++; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c:1579:4: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1577| # 1578| *newRDN++ = newAVA; # 1579|-> tag = ber_skip_tag( ber, &len ); # 1580| tag = ber_get_stringbv( ber, &Oid, LBER_BV_NOTERM ); # 1581| if ( tag != LBER_TAG_OID ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls2.c:1677:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1675| } # 1676| *newRDN++ = NULL; # 1677|-> tag = ber_next_element( ber, &len, dn_end ); # 1678| } # 1679| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls_o.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls_o.c:57:9: warning: "SSL_get_peer_certificate" redefined openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls_o.c:41: included_from: Included from here. /usr/include/openssl/ssl.h:1830:12: note: this is the location of the previous definition # 55| #if OPENSSL_VERSION_MAJOR >= 3 # 56| #define ERR_get_error_line( a, b ) ERR_get_error_all( a, b, NULL, NULL, NULL ) # 57|-> #define SSL_get_peer_certificate( s ) SSL_get1_peer_certificate( s ) # 58| #endif # 59| typedef SSL_CTX tlso_ctx; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls_o.c: scope_hint: In function ‘tlso_ctx_cipher13’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tls_o.c:306:13: warning[-Wunused-variable]: unused variable ‘ret’ # 306 | int ret; # | ^~~ # 304| STACK_OF(SSL_CIPHER) *cs; # 305| SSL *s = SSL_new( ctx ); # 306|-> int ret; # 307| # 308| *oldsuites = NULL; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tpool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tpool.c:819:3: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 817| # 818| if ( rc == 0 ) { # 819|-> return count; # 820| } # 821| Error: CPPCHECK_WARNING (CWE-823): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/tpool.c:1396: error[arrayIndexOutOfBounds]: Array 'ctx->ltu_key[32]' accessed at index 32, which is out of bounds. # 1394| if ( olddatap ) { # 1395| if ( found ) { # 1396|-> *olddatap = ctx->ltu_key[i].ltk_data; # 1397| } else { # 1398| *olddatap = NULL; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/unbind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/url.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/urltest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/utf-8-conv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/utf-8.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/vc.c:169:6: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 167| if (tag == LBER_BOOLEAN) { # 168| ber_int_t crit; # 169|-> tag = ber_scanf(ber, "b", &crit); # 170| tctrl->ldctl_iscritical = crit ? (char) 0 : (char) ~0; # 171| tag = ber_peek_tag(ber, &len); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/vc.c:175:21: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 173| # 174| if (tag == LBER_OCTETSTRING) { # 175|-> tag = ber_scanf( ber, "o", &tctrl->ldctl_value ); # 176| } else { # 177| BER_BVZERO( &tctrl->ldctl_value ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/vc.c:254:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 252| LDAPControl *const *c; # 253| # 254|-> rc = ber_printf(ber, "t{" /*"}"*/, LDAP_TAG_EXOP_VERIFY_CREDENTIALS_CONTROLS); # 255| # 256| for (c=vcctrls; *c; c++) { Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: libldap.la 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/libldap/vlvctrl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c:135: error[memleakOnRealloc]: Common realloc mistake: 'idn' nulled but not freed upon failure # 133| MDB_IDL idn = *idp-1; # 134| /* grow it */ # 135|-> idn = realloc(idn, (*idn + num + 2) * sizeof(MDB_ID)); # 136| if (!idn) # 137| return ENOMEM; Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c: scope_hint: In function ‘mdb_midl_append’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c:167:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 165| } # 166| ids[0]++; # 167|-> ids[ids[0]] = id; # 168| return 0; # 169| } Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c: scope_hint: In function ‘mdb_midl_append_list’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c:181:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 179| } # 180| memcpy(&ids[ids[0]+1], &app[1], app[0] * sizeof(MDB_ID)); # 181|-> ids[0] += app[0]; # 182| return 0; # 183| } Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c: scope_hint: In function ‘mdb_midl_append_range’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblmdb/midl.c:196:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 194| ids[0] = len + n; # 195| ids += len; # 196|-> while (n) # 197| ids[n--] = id++; # 198| return 0; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ucdata/ucdata.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ucstr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ucstr.c: scope_hint: In function ‘UTF8bvnormalize’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ucstr.c:111:58: warning[-Wunused-but-set-variable]: variable ‘last’ set but not used # 111 | int i, j, len, clen, outpos, ucsoutlen, outsize, last; # | ^~~~ # 109| void *ctx ) # 110| { # 111|-> int i, j, len, clen, outpos, ucsoutlen, outsize, last; # 112| int didnewbv = 0; # 113| char *out, *outtmp, *s; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ucstr.c:285:3: warning[deadcode.DeadStores]: Value stored to 'last' is never read # 283| } # 284| # 285|-> last = i; # 286| # 287| /* Allocate more space in out if necessary */ Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c: scope_hint: In function ‘_ure_add_range’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c:526:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rp’ # 524| # 525| ccl->ranges_used++; # 526|-> rp->min_code = r->min_code; # 527| rp->max_code = r->max_code; # 528| } Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c: scope_hint: In function ‘_ure_compile_symbol’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c:1017:27: warning[-Wanalyzer-malloc-leak]: leak of ‘symbol.sym.ccl.ranges’ # 1015| # 1016| if (0xdc00 <= *sp && *sp <= 0xdfff) { # 1017|-> symp->sym.chr = 0x10000 + (((symp->sym.chr & 0x03ff) << 10) | # 1018| (*sp & 0x03ff)); # 1019| sp++; Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c: scope_hint: In function ‘_ure_make_symbol’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c:1103:28: warning[-Wanalyzer-malloc-leak]: leak of ‘symbol.sym.ccl.ranges’ # 1101| free((char *) symbol.sym.ccl.ranges); # 1102| # 1103|-> return b->symtab[i].id; # 1104| } # 1105| Error: CPPCHECK_WARNING (CWE-758): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c:1859: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 1857| fprintf(out, "\\p"); # 1858| for (k = h = 0; k < 32; k++) { # 1859|-> if (sym->props & (1 << k)) { # 1860| if (h != 0) # 1861| putc(',', out); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/ure.c:1978:18: warning[deadcode.DeadStores]: Although the value stored to 'skip' is used in the enclosing expression, the value is never actually read from 'skip' # 1976| stp = dfa->states; # 1977| # 1978|-> for (found = skip = 0; found == 0 && sp < ep; ) { # 1979| lp = sp; # 1980| c = *sp++; Error: CPPCHECK_WARNING (CWE-758): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/ure/urestubs.c:120: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 118| # 119| for( i=0; i<32; i++ ) { # 120|-> if( props & (1 << i) ) { # 121| mask1 |= masks[i].mask1; # 122| mask2 |= masks[i].mask2; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblunicode/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: liblunicode.a 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/base64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:117:3: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 115| fprintf(stderr, "\n"); # 116| fflush(stderr); # 117|-> SETFLAGS( ttyb, flags ); # 118| if (SETATTR(fileno(fi), &ttyb) < 0) # 119| perror("SETATTR"); Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c: scope_hint: In function ‘lutil_getpass’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:125:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fi’ # 123| #endif # 124| if ( c == EOF ) # 125|-> return( NULL ); # 126| pbuf[i] = '\0'; # 127| return (pbuf); Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/getpass.c:125:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fi’ # 123| #endif # 124| if ( c == EOF ) # 125|-> return( NULL ); # 126| pbuf[i] = '\0'; # 127| return (pbuf); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/hash.c:69:33: warning[-Warray-parameter=]: argument 1 of type ‘unsigned char *’ declared as a pointer # 69 | lutil_HASHFinal( unsigned char *digest, lutil_HASH_CTX *ctx ) # | ~~~~~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1181: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/hash.c:22: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_hash.h:52:23: note: previously declared as an array ‘unsigned char[4]’ # 52 | unsigned char digest[LUTIL_HASH_BYTES], # | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 67| */ # 68| void # 69|-> lutil_HASHFinal( unsigned char *digest, lutil_HASH_CTX *ctx ) # 70| { # 71| ber_uint_t h = ctx->hash; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/hash.c:128:35: warning[-Warray-parameter=]: argument 1 of type ‘unsigned char *’ declared as a pointer # 128 | lutil_HASH64Final( unsigned char *digest, lutil_HASH_CTX *ctx ) # | ~~~~~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_hash.h:71:23: note: previously declared as an array ‘unsigned char[8]’ # 71 | unsigned char digest[LUTIL_HASH64_BYTES], # | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 126| */ # 127| void # 128|-> lutil_HASH64Final( unsigned char *digest, lutil_HASH_CTX *ctx ) # 129| { # 130| unsigned long long h = ctx->hash64; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/md5.c:150:32: warning[-Warray-parameter=]: argument 1 of type ‘unsigned char *’ declared as a pointer # 150 | lutil_MD5Final( unsigned char *digest, struct lutil_MD5Context *ctx ) # | ~~~~~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1181: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/md5.c:46: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_md5.h:49:23: note: previously declared as an array ‘unsigned char[16]’ # 49 | unsigned char digest[16], # | ~~~~~~~~~~~~~~^~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 148| */ # 149| void # 150|-> lutil_MD5Final( unsigned char *digest, struct lutil_MD5Context *ctx ) # 151| { # 152| unsigned count; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/md5.c:211:33: warning[-Warray-parameter=]: argument 1 of type ‘ber_uint_t *’ {aka ‘unsigned int *’} declared as a pointer # 211 | lutil_MD5Transform( ber_uint_t *buf, const unsigned char *inraw ) # | ~~~~~~~~~~~~^~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_md5.h:54:20: note: previously declared as an array ‘ber_uint_t[4]’ {aka ‘unsigned int[4]’} # 54 | ber_uint_t buf[4], # | ~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 209| */ # 210| void # 211|-> lutil_MD5Transform( ber_uint_t *buf, const unsigned char *inraw ) # 212| { # 213| register ber_uint_t a, b, c, d; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/md5.c:211:59: warning[-Warray-parameter=]: argument 2 of type ‘const unsigned char *’ declared as a pointer # 211 | lutil_MD5Transform( ber_uint_t *buf, const unsigned char *inraw ) # | ~~~~~~~~~~~~~~~~~~~~~^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_md5.h:55:29: note: previously declared as an array ‘const unsigned char[64]’ # 55 | const unsigned char in[64])); # | ~~~~~~~~~~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 209| */ # 210| void # 211|-> lutil_MD5Transform( ber_uint_t *buf, const unsigned char *inraw ) # 212| { # 213| register ber_uint_t a, b, c, d; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/meter.c:305:4: warning[deadcode.DeadStores]: Value stored to 'buf' is never read # 303| if ( byte_rate >= 1024.0 ) { # 304| snprintf( buf, buf_end-buf, " fast!" ); # 305|-> buf += 6; # 306| } else { # 307| snprintf( buf, buf_end-buf, " spd %5.1f %c/s", Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/meter.c:310:4: warning[deadcode.DeadStores]: Value stored to 'buf' is never read # 308| byte_rate, # 309| *prefix_chp); # 310|-> buf += 5+6+4; # 311| } # 312| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/passwd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sasl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sasl.c:196:22: warning[core.NullDereference]: Access to field 'resps' results in a dereference of a null pointer (loaded from variable 'defaults') # 194| char *p = (char *)interact->result; # 195| ldap_charray_add(&defaults->resps, interact->result); # 196|-> interact->result = defaults->resps[defaults->nresps++]; # 197| # 198| /* zap */ Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:80:30: warning[-Warray-parameter=]: argument 1 of type ‘uint32 *’ {aka ‘unsigned int *’} declared as a pointer # 80 | lutil_SHA1Transform( uint32 *state, const unsigned char *buffer ) # | ~~~~~~~~^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1181: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:39: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_sha1.h:47:24: note: previously declared as an array ‘uint32[5]’ {aka ‘unsigned int[5]’} # 47 | LDAP_P((uint32 state[5], const unsigned char buffer[64])); # | ~~~~~~~^~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 78| */ # 79| void # 80|-> lutil_SHA1Transform( uint32 *state, const unsigned char *buffer ) # 81| { # 82| uint32 a, b, c, d, e; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:80:58: warning[-Warray-parameter=]: argument 2 of type ‘const unsigned char *’ declared as a pointer # 80 | lutil_SHA1Transform( uint32 *state, const unsigned char *buffer ) # | ~~~~~~~~~~~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_sha1.h:47:54: note: previously declared as an array ‘const unsigned char[64]’ # 47 | LDAP_P((uint32 state[5], const unsigned char buffer[64])); # | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 78| */ # 79| void # 80|-> lutil_SHA1Transform( uint32 *state, const unsigned char *buffer ) # 81| { # 82| uint32 a, b, c, d, e; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:128:5: warning[deadcode.DeadStores]: Value stored to 'a' is never read # 126| # 127| /* Wipe variables */ # 128|-> a = b = c = d = e = 0; # 129| } # 130| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:128:9: warning[deadcode.DeadStores]: Although the value stored to 'b' is used in the enclosing expression, the value is never actually read from 'b' # 126| # 127| /* Wipe variables */ # 128|-> a = b = c = d = e = 0; # 129| } # 130| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:128:13: warning[deadcode.DeadStores]: Although the value stored to 'c' is used in the enclosing expression, the value is never actually read from 'c' # 126| # 127| /* Wipe variables */ # 128|-> a = b = c = d = e = 0; # 129| } # 130| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:128:17: warning[deadcode.DeadStores]: Although the value stored to 'd' is used in the enclosing expression, the value is never actually read from 'd' # 126| # 127| /* Wipe variables */ # 128|-> a = b = c = d = e = 0; # 129| } # 130| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:128:21: warning[deadcode.DeadStores]: Although the value stored to 'e' is used in the enclosing expression, the value is never actually read from 'e' # 126| # 127| /* Wipe variables */ # 128|-> a = b = c = d = e = 0; # 129| } # 130| Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/sha1.c:182:33: warning[-Warray-parameter=]: argument 1 of type ‘unsigned char *’ declared as a pointer # 182 | lutil_SHA1Final( unsigned char *digest, lutil_SHA1_CTX *context ) # | ~~~~~~~~~~~~~~~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil_sha1.h:59:31: note: previously declared as an array ‘unsigned char[20]’ # 59 | LDAP_P((unsigned char digest[20], lutil_SHA1_CTX *context)); # | ~~~~~~~~~~~~~~^~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 180| */ # 181| void # 182|-> lutil_SHA1Final( unsigned char *digest, lutil_SHA1_CTX *context ) # 183| { # 184| unsigned int i; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/utils.c:778: warning[uninitvar]: Uninitialized variable: j # 776| } # 777| } # 778|-> j++; # 779| prev->beg += j; # 780| prev->len -= j; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/utils.c: scope_hint: In function ‘scale’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/utils.c:778:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘j’ # 776| } # 777| } # 778|-> j++; # 779| prev->beg += j; # 780| prev->len -= j; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/uuid.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/liblutil/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: liblutil.a 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/config.c:376: error[uninitvar]: Uninitialized variables: tmp.lb_type, tmp.lb_private, tmp.lb_mapper, tmp.lb_mutex # 374| # 375| return ( struct rewrite_builtin_map * )ldap_avl_find( info->li_maps, # 376|-> ( caddr_t )&tmp, rewrite_builtin_map_cmp ); # 377| } # 378| Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/context.c:89: error[uninitvar]: Uninitialized variables: c.lc_alias, c.lc_rule # 87| c.lc_name = (char *)rewriteContext; # 88| context = (struct rewrite_context *)ldap_avl_find( info->li_context, # 89|-> (caddr_t)&c, rewrite_context_cmp ); # 90| if ( context == NULL ) { # 91| return NULL; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/escapemap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c:20: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c: scope_hint: In function ‘map_ldap_parse’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c:136:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c:23: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c:102:16: note: in expansion of macro ‘calloc’ # 134| /* trim everything after [host][:port] */ # 135| p = strchr( data->lm_url, '/' ); # 136|-> assert( p[ 1 ] == '/' ); # 137| if ( ( p = strchr( p + 2, '/' ) ) != NULL ) { # 138| p[ 0 ] = '\0'; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/ldapmap.c:337:3: warning[deadcode.DeadStores]: Value stored to 'set_version' is never read # 335| ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, # 336| (void *)&data->lm_version ); # 337|-> set_version = 0; # 338| } # 339| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c:172:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 170| # 171| default: # 172|-> end = strrchr( begin, ')' ); # 173| if ( end == NULL ) { # 174| rc = -1; Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c: scope_hint: In function ‘rewrite_map_parse’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c:172:23: warning[-Wanalyzer-null-argument]: use of NULL ‘begin’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c:20: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c:28: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c:58:22: note: in expansion of macro ‘IS_REWRITE_SUBMATCH_ESCAPE’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/rewrite-int.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:86:31: note: in expansion of macro ‘SAFEMEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/map.c:94:9: note: in expansion of macro ‘AC_MEMCPY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:21: included_from: Included from here. /usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null # 170| # 171| default: # 172|-> end = strrchr( begin, ')' ); # 173| if ( end == NULL ) { # 174| rc = -1; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/parse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/parse.c:110:9: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 108| break; # 109| case 1: # 110|-> if ( strncasecmp( argv[ 0 ], "rewrite", 7 ) == 0 ) { # 111| int rc; # 112| rc = rewrite_parse( info, "file", lineno, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/rewrite.c:68:9: warning[deadcode.DeadStores]: Value stored to 'errmsg' during its initialization is never read # 66| sep ? sep = strchr( rewriteContext, ',' ) : NULL ) # 67| { # 68|-> char *errmsg = ""; # 69| # 70| if ( sep != NULL ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/rule.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/session.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/session.c:92: error[uninitvar]: Uninitialized variables: tmp.ls_vars, tmp.ls_vars_mutex, tmp.ls_mutex, tmp.ls_count # 90| tmp.ls_cookie = ( void * )cookie; # 91| session = ( struct rewrite_session * )ldap_avl_find( info->li_cookies, # 92|-> ( caddr_t )&tmp, rewrite_cookie_cmp ); # 93| if ( session ) { # 94| session->ls_count++; Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/session.c:165: error[uninitvar]: Uninitialized variables: tmp.ls_vars, tmp.ls_vars_mutex, tmp.ls_mutex, tmp.ls_count # 163| #endif /* USE_REWRITE_LDAP_PVT_THREADS */ # 164| session = ( struct rewrite_session * )ldap_avl_find( info->li_cookies, # 165|-> ( caddr_t )&tmp, rewrite_cookie_cmp ); # 166| #ifdef USE_REWRITE_LDAP_PVT_THREADS # 167| if ( session ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/subst.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/subst.c: scope_hint: In function ‘rewrite_subst_apply’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/subst.c:318:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘submatch’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/subst.c:20: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/subst.c:22: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/subst.c:305:28: note: in expansion of macro ‘calloc’ # 316| struct berval key = { 0, NULL }; # 317| # 318|-> submatch[ n ].bv_val = NULL; # 319| # 320| /* Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/var.c:116: error[uninitvar]: Uninitialized variables: var.lv_flags, var.lv_value # 114| var.lv_name = ( char * )name; # 115| return ( struct rewrite_var * )ldap_avl_find( tree, # 116|-> ( caddr_t )&var, rewrite_var_cmp ); # 117| } # 118| Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: librewrite.a 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/libraries/librewrite/xmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/backend.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c:184:45: warning[-Wmissing-braces]: missing braces around initializer # 184 | static ConfigTable config_back_cf_table[] = { # | ^ # 182| /* alphabetical ordering */ # 183| # 184|-> static ConfigTable config_back_cf_table[] = { # 185| /* This attr is read-only */ # 186| { "", "", 0, 0, 0, Error: COMPILER_WARNING (CWE-681): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c: scope_hint: In function ‘lload_config_find_keyword’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c:2280:48: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘lutil_b64_pton’ differ in signedness # 2280 | c->linelen = lutil_b64_pton( c->line, c->tline, decode_len ); # | ~^~~~~~~ # | | # | char * openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1181: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil.h:55:9: note: expected ‘unsigned char *’ but argument is of type ‘char *’ # 55 | unsigned char *, # | ^~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 2278| ch_free( c->tline ); # 2279| c->tline = ch_malloc( decode_len + 1 ); # 2280|-> c->linelen = lutil_b64_pton( c->line, c->tline, decode_len ); # 2281| if ( c->linelen < 0 ) { # 2282| ch_free( c->tline ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c:2318:15: warning[deadcode.DeadStores]: Value stored to 'ignored' during its initialization is never read # 2316| } # 2317| if ( Conf->max_args && ( c->argc > Conf->max_args ) ) { # 2318|-> char *ignored = " ignored"; # 2319| # 2320| snprintf( c->cr_msg, sizeof(c->cr_msg), "<%s> extra cruft after <%s>", Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/config.c:3423:13: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'next') # 3421| next = line; # 3422| } # 3423|-> while ( *next && strchr( sep, *next ) ) { # 3424| next++; # 3425| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/connection.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:257: warning[nullPointer]: Possible null pointer dereference: host # 255| sap[1] = NULL; # 256| # 257|-> if ( strlen( host ) > # 258| ( sizeof( ((struct sockaddr_un *)*sap)->sun_path ) - 1 ) ) { # 259| Debug( LDAP_DEBUG_ANY, "lload_get_listener_addresses: " Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c: scope_hint: In function ‘lload_get_listener_addresses’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:257:14: warning[-Wanalyzer-null-argument]: use of NULL ‘host’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:27: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 255| sap[1] = NULL; # 256| # 257|-> if ( strlen( host ) > # 258| ( sizeof( ((struct sockaddr_un *)*sap)->sun_path ) - 1 ) ) { # 259| Debug( LDAP_DEBUG_ANY, "lload_get_listener_addresses: " Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:257:14: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 255| sap[1] = NULL; # 256| # 257|-> if ( strlen( host ) > # 258| ( sizeof( ((struct sockaddr_un *)*sap)->sun_path ) - 1 ) ) { # 259| Debug( LDAP_DEBUG_ANY, "lload_get_listener_addresses: " Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:468:20: warning[core.NullDereference]: Array access (from variable 'sal') results in a null pointer dereference # 466| * for it in the lload_listeners array. # 467| */ # 468|-> for ( num = 0; sal[num]; num++ ) /* empty */; # 469| if ( num > 1 ) { # 470| *listeners += num - 1; Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c: scope_hint: In function ‘lload_resume_listeners’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:1976:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘**lload_listeners.sl_sd’ # 1974| lload_listeners[i]->sl_mute = 0; # 1975| listen( lload_listeners[i]->sl_sd, SLAPD_LISTEN_BACKLOG ); # 1976|-> evconnlistener_enable( lload_listeners[i]->listener ); # 1977| } # 1978| } Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/daemon.c:1976:47: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘**lload_listeners.sl_sd’ # 1974| lload_listeners[i]->sl_mute = 0; # 1975| listen( lload_listeners[i]->sl_sd, SLAPD_LISTEN_BACKLOG ); # 1976|-> evconnlistener_enable( lload_listeners[i]->listener ); # 1977| } # 1978| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/epoch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/extended.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/monitor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/monitor.c: scope_hint: In function ‘lload_monitor_conn_update’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/monitor.c:615:19: warning[-Wunused-variable]: unused variable ‘active’ # 615 | ldap_pvt_mp_t active, pending, received, completed, failed; # | ^~~~~~ # 613| LloadConnection *c = priv; # 614| struct berval bv_type, bv_state; # 615|-> ldap_pvt_mp_t active, pending, received, completed, failed; # 616| # 617| CONNECTION_LOCK(c); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/monitor.c:750:22: warning[-Wunused-variable]: unused variable ‘mp’ # 750 | monitor_entry_t *mp; # | ^~ # 748| struct berval bv_rdn, bv_timestamp, zero = BER_BVC("0"), # 749| value = BER_BVC("unknown"); # 750|-> monitor_entry_t *mp; # 751| monitor_callback_t *cb; # 752| Entry *e; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/monitor.c: scope_hint: In function ‘lload_monitor_conn_entry_create’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/monitor.c:753:16: warning[-Wunused-variable]: unused variable ‘a’ # 753 | Attribute *a; # | ^ # 751| monitor_callback_t *cb; # 752| Entry *e; # 753|-> Attribute *a; # 754| BackendInfo *mi = backend_info( "monitor" ); # 755| monitor_extra_t *mbe = mi->bi_extra; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/operation.c: scope_hint: In function ‘operation_unlink’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/operation.c:234:15: warning[-Wunused-variable]: unused variable ‘prev_refcnt’ # 234 | uintptr_t prev_refcnt; # | ^~~~~~~~~~~ # 232| { # 233| LloadConnection *client, *upstream; # 234|-> uintptr_t prev_refcnt; # 235| int result = 0; # 236| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/tier_bestof.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/tier_bestof.c:145:1: warning[-Wunused-function]: ‘bestof_backend_options’ defined but not used # 145 | bestof_backend_options( LloadTier *tier, LloadBackend *b, char *arg ) # | ^~~~~~~~~~~~~~~~~~~~~~ # 143| # 144| static int # 145|-> bestof_backend_options( LloadTier *tier, LloadBackend *b, char *arg ) # 146| { # 147| struct berval weight = BER_BVC("weight="); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/tier_roundrobin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/tier_weighted.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/upstream.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/lloadd/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: lloadd 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:456:9: warning[core.CallAndMessage]: Called function pointer is null (null dereference) # 454| /* use default (but pass through frontend # 455| * for global ACL overlays) */ # 456|-> ret = frontendDB->bd_info->bi_access_allowed( op, e, # 457| desc, val, access, state, &mask ); # 458| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:648:10: warning[core.NullDereference]: Dereference of null pointer # 646| a->acl_attrval.bv_val ); # 647| # 648|-> if ( a->acl_attrs[0].an_desc->ad_type->sat_syntax != slap_schema.si_syn_distinguishedName ) { # 649| if (value_match( &match, desc, # 650| a->acl_attrval_mr, 0, Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c: scope_hint: In function ‘slap_acl_mask’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:1157:29: warning[-Wunused-but-set-variable]: variable ‘oldmask’ set but not used # 1157 | slap_mask_t oldmask, modmask; # | ^~~~~~~ # 1155| # 1156| for ( ; b != NULL; b = b->a_next, i++ ) { # 1157|-> slap_mask_t oldmask, modmask; # 1158| # 1159| ACL_INVALIDATE( modmask ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:1849:3: warning[deadcode.DeadStores]: Value stored to 'oldmask' is never read # 1847| : "stop" ); # 1848| /* save old mask */ # 1849|-> oldmask = *mask; # 1850| # 1851| if( ACL_IS_ADDITIVE(modmask) ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:2188:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2186| cp->asc_op->o_log_prefix, name->bv_val ); # 2187| # 2188|-> rc = LDAP_PROTOCOL_ERROR; # 2189| goto url_done; # 2190| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:2200:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2198| cp->asc_op->o_log_prefix, name->bv_val ); # 2199| # 2200|-> rc = LDAP_PROTOCOL_ERROR; # 2201| goto url_done; # 2202| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:2223:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2221| cp->asc_op->o_log_prefix, op2.o_req_ndn.bv_val ); # 2222| # 2223|-> rc = LDAP_NO_SUCH_OBJECT; # 2224| goto url_done; # 2225| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/acl.c:2237:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2235| cp->asc_op->o_log_prefix, op2.ors_filterstr.bv_val ); # 2236| # 2237|-> rc = LDAP_PROTOCOL_ERROR; # 2238| goto url_done; # 2239| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:137:2: warning[deadcode.DeadStores]: Value stored to 'size' is never read # 135| sp = pat; # 136| dp = buf; # 137|-> size = 0; # 138| buf[0] = '\0'; # 139| Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: scope_hint: In function ‘regtest’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:173:77: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 173 | "regular expression \"%s\" bad because of %s", pat, error); # | ^~ ~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 171| # 172| snprintf( c->cr_msg, sizeof ( c->cr_msg ), # 173|-> "regular expression \"%s\" bad because of %s", pat, error); # 174| Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg ); # 175| acl_usage(); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:337:6: warning[deadcode.DeadStores]: Value stored to 'lineno' during its initialization is never read # 335| Backend *be = c->be; # 336| const char *fname = c->fname; # 337|-> int lineno = c->lineno; # 338| int argc = c->argc; # 339| char **argv = c->argv; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: scope_hint: In function ‘parse_acl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:337:13: warning[-Wunused-variable]: unused variable ‘lineno’ # 337 | int lineno = c->lineno; # | ^~~~~~ # 335| Backend *be = c->be; # 336| const char *fname = c->fname; # 337|-> int lineno = c->lineno; # 338| int argc = c->argc; # 339| char **argv = c->argv; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: scope_hint: In function ‘parse_acl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:534:113: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 534 | "regular expression \"%s\" bad because of %s", # | ^~ # 535 | right, err ); # | ~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 532| regerror( e, &a->acl_attrval_re, err, sizeof( err ) ); # 533| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 534|-> "regular expression \"%s\" bad because of %s", # 535| right, err ); # 536| Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:674:7: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value # 672| # 673| regerror( e, &a->acl_dn_re, err, sizeof( err ) ); # 674|-> snprintf( c->cr_msg, sizeof( c->cr_msg ), # 675| "regular expression \"%s\" bad because of %s", # 676| right, err ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: scope_hint: In function ‘parse_acl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:675:97: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 675 | "regular expression \"%s\" bad because of %s", # | ^~ # 676 | right, err ); # | ~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 673| regerror( e, &a->acl_dn_re, err, sizeof( err ) ); # 674| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 675|-> "regular expression \"%s\" bad because of %s", # 676| right, err ); # 677| Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2489:9: warning[core.NullDereference]: Dereference of null pointer # 2487| dnaccess2text( slap_dn_access *bdn, char *ptr, int is_realdn ) # 2488| { # 2489|-> *ptr++ = ' '; # 2490| # 2491| if ( is_realdn ) { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: scope_hint: In function ‘dnaccess2text’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2489:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2762:23: note: in expansion of macro ‘acl_safe_strcopy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2762:23: note: in expansion of macro ‘acl_safe_strcopy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2541:15: note: in expansion of macro ‘acl_safe_strcopy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2541:15: note: in expansion of macro ‘acl_safe_strcopy’ # 2487| dnaccess2text( slap_dn_access *bdn, char *ptr, int is_realdn ) # 2488| { # 2489|-> *ptr++ = ' '; # 2490| # 2491| if ( is_realdn ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2669:7: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 2667| } # 2668| ptr = acl_safe_strcopy( ptr, accessmask2str( b->a_access_mask, maskbuf, 0 )); # 2669|-> if ( !maskbuf[0] ) ptr--; # 2670| # 2671| if( b->a_type == ACL_BREAK ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2751:4: warning[core.NullDereference]: Dereference of null pointer # 2749| ptr = acl_safe_strcopy( ptr, " val." ); # 2750| if ( a->acl_attrval_style == ACL_STYLE_BASE && # 2751|-> a->acl_attrs[0].an_desc->ad_type->sat_syntax == # 2752| slap_schema.si_syn_distinguishedName ) # 2753| ptr = acl_safe_strcopy( ptr, style_base ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c: scope_hint: In function ‘acl_unparse’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/aclparse.c:2768:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’ # 2766| ptr = access2text( b, ptr ); # 2767| } # 2768|-> *ptr = '\0'; # 2769| bv->bv_val = aclbuf.bv_val; # 2770| bv->bv_len = ptr - bv->bv_val; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ad.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/add.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/add.c:237:18: warning[deadcode.DeadStores]: Value stored to 'modtail' during its initialization is never read # 235| fe_op_add( Operation *op, SlapReply *rs ) # 236| { # 237|-> Modifications **modtail = &op->ora_modlist; # 238| int rc = 0; # 239| BackendDB *op_be, *bd = op->o_bd; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/at.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/attr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ava.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ava.c:131:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 129| ber_dupbv_x( &aa->aa_value, &value, op->o_tmpmemctx ); # 130| *text = NULL; # 131|-> rc = LDAP_SUCCESS; # 132| } # 133| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/add.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/add.c: scope_hint: In function ‘asyncmeta_back_add’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/add.c:245:15: warning[-Wunused-variable]: unused variable ‘thrctx’ # 245 | void *thrctx = op->o_threadctx; # | ^~~~~~ # 243| a_metaconn_t *mc; # 244| int rc, candidate = -1; # 245|-> void *thrctx = op->o_threadctx; # 246| bm_context_t *bc; # 247| SlapReply *candidates; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:36: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/back-asyncmeta.h:218:57: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/back-asyncmeta.h:220:49: note: in expansion of macro ‘META_BACK_CMN_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1139:40: note: in expansion of macro ‘META_BACK_CMN_CHASE_REFERRALS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/back-asyncmeta.h:220:49: note: in expansion of macro ‘META_BACK_CMN_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1139:40: note: in expansion of macro ‘META_BACK_CMN_CHASE_REFERRALS’ # 216| # 217| unsigned mc_flags; # 218|-> #define META_BACK_CMN_ISSET(mc,f) ( ( (mc)->mc_flags & (f) ) == (f) ) # 219| #define META_BACK_CMN_QUARANTINE(mc) META_BACK_CMN_ISSET( (mc), LDAP_BACK_F_QUARANTINE ) # 220| #define META_BACK_CMN_CHASE_REFERRALS(mc) META_BACK_CMN_ISSET( (mc), LDAP_BACK_F_CHASE_REFERRALS ) Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/candidates.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/candidates.c:59:19: warning[deadcode.DeadStores]: Value stored to 'ms' during its initialization is never read # 57| asyncmeta_subtree_match( a_metatarget_t *mt, struct berval *ndn, int scope ) # 58| { # 59|-> a_metasubtree_t *ms = mt->mt_subtree; # 60| # 61| for ( ms = mt->mt_subtree; ms; ms = ms->ms_next ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/compare.c:187:8: warning[deadcode.DeadStores]: Value stored to 'thrctx' during its initialization is never read # 185| a_metaconn_t *mc; # 186| int rc, candidate = -1; # 187|-> void *thrctx = op->o_threadctx; # 188| bm_context_t *bc; # 189| SlapReply *candidates; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/compare.c: scope_hint: In function ‘asyncmeta_back_compare’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/compare.c:187:15: warning[-Wunused-variable]: unused variable ‘thrctx’ # 187 | void *thrctx = op->o_threadctx; # | ^~~~~~ # 185| a_metaconn_t *mc; # 186| int rc, candidate = -1; # 187|-> void *thrctx = op->o_threadctx; # 188| bm_context_t *bc; # 189| SlapReply *candidates; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:100:34: warning[-Wmissing-braces]: missing braces around initializer # 100 | static ConfigTable a_metacfg[] = { # | ^ # 98| }; # 99| # 100|-> static ConfigTable a_metacfg[] = { # 101| { "uri", "uri", 2, 0, 0, # 102| ARG_MAGIC|LDAP_BACK_CFG_URI, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:604:18: warning[core.NullDereference]: Access to field 'mt_lsuffixm' results in a dereference of a null pointer (loaded from variable 'mt') # 602| } # 603| # 604|-> mt->mt_lsuffixm = pvnc; # 605| mt->mt_rsuffixm = prnc; # 606| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: scope_hint: In function ‘asyncmeta_suffixm_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:604:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:23: included_from: Included from here. # 602| } # 603| # 604|-> mt->mt_lsuffixm = pvnc; # 605| mt->mt_rsuffixm = prnc; # 606| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:675:8: warning[core.NullDereference]: Access to field 'mt_subtree' results in a dereference of a null pointer (loaded from variable 'mt') # 673| struct berval bv, *style; # 674| # 675|-> if ( !mt->mt_subtree ) # 676| return 1; # 677| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: scope_hint: In function ‘asyncmeta_subtree_unparse’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:675:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 673| struct berval bv, *style; # 674| # 675|-> if ( !mt->mt_subtree ) # 676| return 1; # 677| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: scope_hint: In function ‘asyncmeta_subtree_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:712:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 710| # 711| if ( c->type == LDAP_BACK_CFG_SUBTREE_EX ) { # 712|-> if ( mt->mt_subtree && !mt->mt_subtree_exclude ) { # 713| snprintf( c->cr_msg, sizeof(c->cr_msg), # 714| "\"subtree-exclude\" incompatible with previous \"subtree-include\" directives" ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:721:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 719| # 720| } else { # 721|-> if ( mt->mt_subtree && mt->mt_subtree_exclude ) { # 722| snprintf( c->cr_msg, sizeof(c->cr_msg), # 723| "\"subtree-include\" incompatible with previous \"subtree-exclude\" directives" ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: scope_hint: In function ‘asyncmeta_subtree_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:812:75: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 812 | "regular expression \"%s\" bad because of %s", # | ^~ # 813 | pattern, regerr ); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 810| # 811| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 812|-> "regular expression \"%s\" bad because of %s", # 813| pattern, regerr ); # 814| ch_free( ms ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1127:32: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 1125| mask &= ~LDAP_BACK_F_CANCEL_EXOP; # 1126| } # 1127|-> enum_to_verb( cancel_mode, (mc->mc_flags & mask), &bv ); # 1128| if ( BER_BVISNULL( &bv ) ) { # 1129| /* there's something wrong... */ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: scope_hint: In function ‘asyncmeta_back_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1127:55: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1125| mask &= ~LDAP_BACK_F_CANCEL_EXOP; # 1126| } # 1127|-> enum_to_verb( cancel_mode, (mc->mc_flags & mask), &bv ); # 1128| if ( BER_BVISNULL( &bv ) ) { # 1129| /* there's something wrong... */ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1165:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1163| # 1164| case LDAP_BACK_CFG_NETWORK_TIMEOUT: # 1165|-> if ( mc->mc_network_timeout == 0 ) { # 1166| return 1; # 1167| } Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1183:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1181| # 1182| case LDAP_BACK_CFG_NRETRIES: # 1183|-> if ( mc->mc_nretries == META_RETRY_FOREVER ) { # 1184| BER_BVSTR( &bv, "forever" ); # 1185| } else if ( mc->mc_nretries == META_RETRY_NEVER ) { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1241:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1239| # 1240| case LDAP_BACK_CFG_VERSION: # 1241|-> if ( mc->mc_version == 0 ) # 1242| return 1; # 1243| c->value_int = mc->mc_version; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1253:52: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1251| # 1252| case LDAP_BACK_CFG_T_F: # 1253|-> enum_to_verb( t_f_mode, (mc->mc_flags & LDAP_BACK_F_T_F_MASK2), &bv ); # 1254| if ( BER_BVISNULL( &bv ) ) { # 1255| /* there's something wrong... */ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1267:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1265| struct berval bc = BER_BVNULL, bv2; # 1266| # 1267|-> if (( mc->mc_flags & LDAP_BACK_F_TLS_MASK ) == LDAP_BACK_F_NONE ) { # 1268| rc = 1; # 1269| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1293:28: warning[core.NullDereference]: Access to field 'mt_uri' results in a dereference of a null pointer (loaded from variable 'mt') # 1291| /* target attrs */ # 1292| case LDAP_BACK_CFG_URI: { # 1293|-> char *p2, *p1 = strchr( mt->mt_uri, ' ' ); # 1294| bv.bv_len = strlen( mt->mt_uri ) + 3 + mt->mt_psuffix.bv_len; # 1295| bv.bv_val = ch_malloc( bv.bv_len + 1 ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1293:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1291| /* target attrs */ # 1292| case LDAP_BACK_CFG_URI: { # 1293|-> char *p2, *p1 = strchr( mt->mt_uri, ' ' ); # 1294| bv.bv_len = strlen( mt->mt_uri ) + 3 + mt->mt_psuffix.bv_len; # 1295| bv.bv_val = ch_malloc( bv.bv_len + 1 ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1319:9: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'bvp') # 1317| # 1318| bvp = &mt->mt_idassert_authz; # 1319|-> if ( *bvp == NULL ) { # 1320| if ( mt->mt_idassert_flags & LDAP_BACK_AUTH_AUTHZ_ALL ) # 1321| { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1319:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1317| # 1318| bvp = &mt->mt_idassert_authz; # 1319|-> if ( *bvp == NULL ) { # 1320| if ( mt->mt_idassert_flags & LDAP_BACK_AUTH_AUTHZ_ALL ) # 1321| { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1338:5: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 1336| ptr = bv.bv_val; # 1337| ptr = lutil_strcopy( ptr, buf ); # 1338|-> ptr = lutil_strncopy( ptr, ((*bvp)[ i ]).bv_val, ((*bvp)[ i ]).bv_len ); # 1339| value_add_one( &c->rvalue_vals, &bv ); # 1340| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1352:9: warning[core.NullDereference]: Dereference of null pointer # 1350| char *ptr; # 1351| # 1352|-> if ( mt->mt_idassert_authmethod == LDAP_AUTH_NONE ) { # 1353| return 1; # 1354| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1376:7: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 1374| # 1375| ptr = lutil_strcopy( bv.bv_val, "mode=" ); # 1376|-> ptr = lutil_strcopy( ptr, mode.bv_val ); # 1377| } # 1378| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1493:9: warning[core.NullDereference]: Dereference of null pointer # 1491| # 1492| case LDAP_BACK_CFG_SUFFIXM: # 1493|-> if ( mt->mt_lsuffixm.bv_val ) { # 1494| struct berval bv; # 1495| char *ptr; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1517:9: warning[core.NullDereference]: Access to field 'mt_filter' results in a dereference of a null pointer (loaded from variable 'mt') # 1515| # 1516| case LDAP_BACK_CFG_FILTER: # 1517|-> if ( mt->mt_filter == NULL ) { # 1518| rc = 1; # 1519| } else { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1517:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1515| # 1516| case LDAP_BACK_CFG_FILTER: # 1517|-> if ( mt->mt_filter == NULL ) { # 1518| rc = 1; # 1519| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1547:20: warning[core.NullDereference]: Dereference of null pointer # 1545| # 1546| case LDAP_BACK_CFG_TCP_USER_TIMEOUT: # 1547|-> c->value_uint = mt->mt_tls.sb_tcp_user_timeout; # 1548| break; # 1549| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1592:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1590| # 1591| case LDAP_BACK_CFG_CANCEL: # 1592|-> mc->mc_flags &= ~LDAP_BACK_F_CANCEL_MASK2; # 1593| break; # 1594| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1596:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1594| # 1595| case LDAP_BACK_CFG_CHASE: # 1596|-> mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; # 1597| break; # 1598| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1616:56: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1614| rc = 1; # 1615| } else { # 1616|-> mc->mc_network_timeout = 0; # 1617| } # 1618| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1621:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1619| # 1620| case LDAP_BACK_CFG_NOREFS: # 1621|-> mc->mc_flags &= ~LDAP_BACK_F_NOREFS; # 1622| break; # 1623| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1625:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1623| # 1624| case LDAP_BACK_CFG_NOUNDEFFILTER: # 1625|-> mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; # 1626| break; # 1627| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1629:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1627| # 1628| case LDAP_BACK_CFG_NRETRIES: # 1629|-> mc->mc_nretries = META_RETRY_DEFAULT; # 1630| break; # 1631| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1644:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1642| # 1643| case LDAP_BACK_CFG_REBIND: # 1644|-> mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; # 1645| break; # 1646| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1660:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1658| rc = 1; # 1659| } else { # 1660|-> mc->mc_version = 0; # 1661| } # 1662| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1666:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1664| #ifdef SLAP_CONTROL_X_SESSION_TRACKING # 1665| case LDAP_BACK_CFG_ST_REQUEST: # 1666|-> mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; # 1667| break; # 1668| #endif /* SLAP_CONTROL_X_SESSION_TRACKING */ Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1671:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1669| # 1670| case LDAP_BACK_CFG_T_F: # 1671|-> mc->mc_flags &= ~LDAP_BACK_F_T_F_MASK2; # 1672| break; # 1673| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1675:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 1673| # 1674| case LDAP_BACK_CFG_TLS: # 1675|-> mc->mc_flags &= ~LDAP_BACK_F_TLS_MASK; # 1676| if ( mt ) # 1677| bindconf_free( &mt->mt_tls ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1688:10: warning[core.NullDereference]: Access to field 'mt_uri' results in a dereference of a null pointer (loaded from variable 'mt') # 1686| rc = 1; # 1687| } else { # 1688|-> if ( mt->mt_uri ) { # 1689| ch_free( mt->mt_uri ); # 1690| mt->mt_uri = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1688:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1686| rc = 1; # 1687| } else { # 1688|-> if ( mt->mt_uri ) { # 1689| ch_free( mt->mt_uri ); # 1690| mt->mt_uri = NULL; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1709:11: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'bvp') # 1707| } else { # 1708| if ( c->valx < 0 ) { # 1709|-> if ( *bvp != NULL ) { # 1710| ber_bvarray_free( *bvp ); # 1711| *bvp = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1709:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1707| } else { # 1708| if ( c->valx < 0 ) { # 1709|-> if ( *bvp != NULL ) { # 1710| ber_bvarray_free( *bvp ); # 1711| *bvp = NULL; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1715:11: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'bvp') # 1713| # 1714| } else { # 1715|-> if ( *bvp == NULL ) { # 1716| rc = 1; # 1717| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1715:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1713| # 1714| } else { # 1715|-> if ( *bvp == NULL ) { # 1716| rc = 1; # 1717| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1745:5: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1743| } else { # 1744| bindconf_free( &mt->mt_idassert.si_bc ); # 1745|-> memset( &mt->mt_idassert, 0, sizeof( slap_idassert_t ) ); # 1746| } # 1747| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1756:10: warning[core.NullDereference]: Dereference of null pointer # 1754| rc = 1; # 1755| } else { # 1756|-> if ( mt->mt_lsuffixm.bv_val ) { # 1757| ch_free( mt->mt_lsuffixm.bv_val ); # 1758| ch_free( mt->mt_rsuffixm.bv_val ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1768:50: warning[core.NullDereference]: Access to field 'mt_subtree_exclude' results in a dereference of a null pointer (loaded from variable 'mt') # 1766| case LDAP_BACK_CFG_SUBTREE_IN: # 1767| /* can only be one of exclude or include */ # 1768|-> if (( c->type == LDAP_BACK_CFG_SUBTREE_EX ) ^ mt->mt_subtree_exclude ) { # 1769| rc = 1; # 1770| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1768:73: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1766| case LDAP_BACK_CFG_SUBTREE_IN: # 1767| /* can only be one of exclude or include */ # 1768|-> if (( c->type == LDAP_BACK_CFG_SUBTREE_EX ) ^ mt->mt_subtree_exclude ) { # 1769| rc = 1; # 1770| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1793:31: warning[core.NullDereference]: Access to field 'mt_filter' results in a dereference of a null pointer (loaded from variable 'mt') # 1791| case LDAP_BACK_CFG_FILTER: # 1792| if ( c->valx < 0 ) { # 1793|-> asyncmeta_filter_destroy( mt->mt_filter ); # 1794| mt->mt_filter = NULL; # 1795| } else { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1793:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1791| case LDAP_BACK_CFG_FILTER: # 1792| if ( c->valx < 0 ) { # 1793|-> asyncmeta_filter_destroy( mt->mt_filter ); # 1794| mt->mt_filter = NULL; # 1795| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1797:44: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'mprev') # 1795| } else { # 1796| metafilter_t *mf, **mprev; # 1797|-> for (i=0, mprev = &mt->mt_filter, mf = *mprev; mf; mf = *mprev) { # 1798| if ( i == c->valx ) { # 1799| *mprev = mf->mf_next; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1797:70: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1795| } else { # 1796| metafilter_t *mf, **mprev; # 1797|-> for (i=0, mprev = &mt->mt_filter, mf = *mprev; mf; mf = *mprev) { # 1798| if ( i == c->valx ) { # 1799| *mprev = mf->mf_next; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1832:37: warning[core.NullDereference]: Dereference of null pointer # 1830| rc = 1; # 1831| } else { # 1832|-> mt->mt_tls.sb_keepalive.sk_idle = 0; # 1833| mt->mt_tls.sb_keepalive.sk_probes = 0; # 1834| mt->mt_tls.sb_keepalive.sk_interval = 0; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1839:35: warning[core.NullDereference]: Dereference of null pointer # 1837| # 1838| case LDAP_BACK_CFG_TCP_USER_TIMEOUT: # 1839|-> mt->mt_tls.sb_tcp_user_timeout = 0; # 1840| break; # 1841| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:1951:16: warning[core.NullDereference]: Array access (from variable 'uris') results in a null pointer dereference # 1949| } # 1950| # 1951|-> for ( j = 0; uris[ j ] != NULL; j++ ) { # 1952| char *tmpuri = NULL; # 1953| Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c: scope_hint: In function ‘asyncmeta_back_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2092:75: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 2092 | "regular expression \"%s\" bad because of %s", # | ^~ # 2093 | c->argv[1], regerr ); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 2090| regerror( rc, &mf->mf_regex, regerr, sizeof(regerr) ); # 2091| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 2092|-> "regular expression \"%s\" bad because of %s", # 2093| c->argv[1], regerr ); # 2094| ch_free( mf ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2098:30: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'm2') # 2096| } # 2097| ber_str2bv( c->argv[1], 0, 1, &mf->mf_regex_pattern ); # 2098|-> for ( m2 = &mt->mt_filter; *m2; m2 = &(*m2)->mf_next ) # 2099| ; # 2100| *m2 = mf; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2205:26: warning[core.NullDereference]: Access to field 'mc_network_timeout' results in a dereference of a null pointer (loaded from variable 'mc') # 2203| return 1; # 2204| } # 2205|-> mc->mc_network_timeout = (time_t)t; # 2206| } break; # 2207| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2205:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2203| return 1; # 2204| } # 2205|-> mc->mc_network_timeout = (time_t)t; # 2206| } break; # 2207| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2225:30: warning[core.NullDereference]: Dereference of null pointer # 2223| case LDAP_BACK_CFG_BIND_TIMEOUT: # 2224| /* bind timeout when connecting to ldap servers */ # 2225|-> mc->mc_bind_timeout.tv_sec = c->value_ulong/1000000; # 2226| mc->mc_bind_timeout.tv_usec = c->value_ulong%1000000; # 2227| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2232:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2230| /* save bind creds for referral rebinds? */ # 2231| if ( c->argc == 1 || c->value_int ) { # 2232|-> mc->mc_flags |= LDAP_BACK_F_SAVECRED; # 2233| } else { # 2234| mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2232:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2230| /* save bind creds for referral rebinds? */ # 2231| if ( c->argc == 1 || c->value_int ) { # 2232|-> mc->mc_flags |= LDAP_BACK_F_SAVECRED; # 2233| } else { # 2234| mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2234:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2232| mc->mc_flags |= LDAP_BACK_F_SAVECRED; # 2233| } else { # 2234|-> mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; # 2235| } # 2236| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2234:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2232| mc->mc_flags |= LDAP_BACK_F_SAVECRED; # 2233| } else { # 2234|-> mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; # 2235| } # 2236| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2240:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2238| case LDAP_BACK_CFG_CHASE: # 2239| if ( c->argc == 1 || c->value_int ) { # 2240|-> mc->mc_flags |= LDAP_BACK_F_CHASE_REFERRALS; # 2241| } else { # 2242| mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2240:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2238| case LDAP_BACK_CFG_CHASE: # 2239| if ( c->argc == 1 || c->value_int ) { # 2240|-> mc->mc_flags |= LDAP_BACK_F_CHASE_REFERRALS; # 2241| } else { # 2242| mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2242:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2240| mc->mc_flags |= LDAP_BACK_F_CHASE_REFERRALS; # 2241| } else { # 2242|-> mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; # 2243| } # 2244| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2242:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2240| mc->mc_flags |= LDAP_BACK_F_CHASE_REFERRALS; # 2241| } else { # 2242|-> mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; # 2243| } # 2244| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2255:16: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2253| return 1; # 2254| } # 2255|-> mc->mc_flags &= ~LDAP_BACK_F_TLS_MASK; # 2256| mc->mc_flags |= tls_mode[i].mask; # 2257| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2255:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2253| return 1; # 2254| } # 2255|-> mc->mc_flags &= ~LDAP_BACK_F_TLS_MASK; # 2256| mc->mc_flags |= tls_mode[i].mask; # 2257| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2283:16: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2281| return 1; # 2282| } # 2283|-> mc->mc_flags &= ~LDAP_BACK_F_T_F_MASK2; # 2284| mc->mc_flags |= t_f_mode[i].mask; # 2285| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2283:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2281| return 1; # 2282| } # 2283|-> mc->mc_flags &= ~LDAP_BACK_F_T_F_MASK2; # 2284| mc->mc_flags |= t_f_mode[i].mask; # 2285| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2346:16: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2344| return 1; # 2345| } # 2346|-> mc->mc_flags &= ~LDAP_BACK_F_CANCEL_MASK2; # 2347| mc->mc_flags |= cancel_mode[i].mask; # 2348| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2346:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2344| return 1; # 2345| } # 2346|-> mc->mc_flags &= ~LDAP_BACK_F_CANCEL_MASK2; # 2347| mc->mc_flags |= cancel_mode[i].mask; # 2348| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2365:26: warning[core.NullDereference]: Array access (via field 'mc_timeout') results in a null pointer dereference # 2363| # 2364| for ( j = 0; j < SLAP_OP_LAST; j++ ) { # 2365|-> mc->mc_timeout[ j ] = u; # 2366| } # 2367| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2393:8: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2391| case LDAP_BACK_CFG_QUARANTINE: # 2392| /* quarantine */ # 2393|-> if ( META_BACK_CMN_QUARANTINE( mc ) ) # 2394| { # 2395| snprintf( c->cr_msg, sizeof( c->cr_msg ), Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2421:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2419| /* session tracking request */ # 2420| if ( c->value_int ) { # 2421|-> mc->mc_flags |= LDAP_BACK_F_ST_REQUEST; # 2422| } else { # 2423| mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2421:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2419| /* session tracking request */ # 2420| if ( c->value_int ) { # 2421|-> mc->mc_flags |= LDAP_BACK_F_ST_REQUEST; # 2422| } else { # 2423| mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2423:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2421| mc->mc_flags |= LDAP_BACK_F_ST_REQUEST; # 2422| } else { # 2423|-> mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; # 2424| } # 2425| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2423:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2421| mc->mc_flags |= LDAP_BACK_F_ST_REQUEST; # 2422| } else { # 2423|-> mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; # 2424| } # 2425| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2451:19: warning[core.NullDereference]: Access to field 'mc_nretries' results in a dereference of a null pointer (loaded from variable 'mc') # 2449| } # 2450| # 2451|-> mc->mc_nretries = nretries; # 2452| } break; # 2453| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2451:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2449| } # 2450| # 2451|-> mc->mc_nretries = nretries; # 2452| } break; # 2453| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2462:18: warning[core.NullDereference]: Access to field 'mc_version' results in a dereference of a null pointer (loaded from variable 'mc') # 2460| return 1; # 2461| } # 2462|-> mc->mc_version = c->value_int; # 2463| break; # 2464| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2462:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2460| return 1; # 2461| } # 2462|-> mc->mc_version = c->value_int; # 2463| break; # 2464| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2468:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2466| /* do not return search references */ # 2467| if ( c->value_int ) { # 2468|-> mc->mc_flags |= LDAP_BACK_F_NOREFS; # 2469| } else { # 2470| mc->mc_flags &= ~LDAP_BACK_F_NOREFS; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2468:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2466| /* do not return search references */ # 2467| if ( c->value_int ) { # 2468|-> mc->mc_flags |= LDAP_BACK_F_NOREFS; # 2469| } else { # 2470| mc->mc_flags &= ~LDAP_BACK_F_NOREFS; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2470:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2468| mc->mc_flags |= LDAP_BACK_F_NOREFS; # 2469| } else { # 2470|-> mc->mc_flags &= ~LDAP_BACK_F_NOREFS; # 2471| } # 2472| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2470:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2468| mc->mc_flags |= LDAP_BACK_F_NOREFS; # 2469| } else { # 2470|-> mc->mc_flags &= ~LDAP_BACK_F_NOREFS; # 2471| } # 2472| break; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2477:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2475| /* do not propagate undefined search filters */ # 2476| if ( c->value_int ) { # 2477|-> mc->mc_flags |= LDAP_BACK_F_NOUNDEFFILTER; # 2478| } else { # 2479| mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2477:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2475| /* do not propagate undefined search filters */ # 2476| if ( c->value_int ) { # 2477|-> mc->mc_flags |= LDAP_BACK_F_NOUNDEFFILTER; # 2478| } else { # 2479| mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2479:17: warning[core.NullDereference]: Access to field 'mc_flags' results in a dereference of a null pointer (loaded from variable 'mc') # 2477| mc->mc_flags |= LDAP_BACK_F_NOUNDEFFILTER; # 2478| } else { # 2479|-> mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; # 2480| } # 2481| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/config.c:2479:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2477| mc->mc_flags |= LDAP_BACK_F_NOUNDEFFILTER; # 2478| } else { # 2479|-> mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; # 2480| } # 2481| break; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/conn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/delete.c:178:8: warning[deadcode.DeadStores]: Value stored to 'thrctx' during its initialization is never read # 176| a_metaconn_t *mc; # 177| int rc, candidate = -1; # 178|-> void *thrctx = op->o_threadctx; # 179| bm_context_t *bc; # 180| SlapReply *candidates; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/delete.c: scope_hint: In function ‘asyncmeta_back_delete’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/delete.c:178:15: warning[-Wunused-variable]: unused variable ‘thrctx’ # 178 | void *thrctx = op->o_threadctx; # | ^~~~~~ # 176| a_metaconn_t *mc; # 177| int rc, candidate = -1; # 178|-> void *thrctx = op->o_threadctx; # 179| bm_context_t *bc; # 180| SlapReply *candidates; Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/dncache.c:105: error[uninitvar]: Uninitialized variables: tmp_entry.target, tmp_entry.lastupdated # 103| ldap_pvt_thread_mutex_lock( &cache->mutex ); # 104| entry = ( metadncacheentry_t * )ldap_avl_find( cache->tree, # 105|-> ( caddr_t )&tmp_entry, asyncmeta_dncache_cmp ); # 106| # 107| if ( entry != NULL ) { Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/dncache.c:161: warning[uninitvar]: Uninitialized variables: tmp_entry.target, tmp_entry.lastupdated # 159| ldap_pvt_thread_mutex_lock( &cache->mutex ); # 160| entry = ( metadncacheentry_t * )ldap_avl_find( cache->tree, # 161|-> ( caddr_t )&tmp_entry, asyncmeta_dncache_cmp ); # 162| # 163| if ( entry != NULL ) { Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/dncache.c:206: error[uninitvar]: Uninitialized variables: tmp_entry.target, tmp_entry.lastupdated # 204| # 205| ldap_pvt_thread_mutex_lock( &cache->mutex ); # 206|-> entry = ldap_avl_delete( &cache->tree, ( caddr_t )&tmp_entry, # 207| asyncmeta_dncache_cmp ); # 208| ldap_pvt_thread_mutex_unlock( &cache->mutex ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/map.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/message_queue.c:210:9: warning[core.NullDereference]: Access to field 'bc_mc' results in a dereference of a null pointer (loaded from variable 'bc') # 208| } # 209| assert(om == bc); # 210|-> assert(bc->bc_mc == mc); # 211| } # 212| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:254:39: warning[-Wformat-overflow=]: ‘%s’ directive argument is null # 254 | "%s meta_send_entry(\"%s\"): " "slap_bv2undef_ad(%s): %s\n", # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 252| { # 253| Debug(LDAP_DEBUG_ANY, # 254|-> "%s meta_send_entry(\"%s\"): " "slap_bv2undef_ad(%s): %s\n", # 255| op->o_log_prefix, ent.e_name.bv_val, # 256| mapped.bv_val, text ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:699:4: warning[core.NullDereference]: Dereference of null pointer # 697| if (bc->op->o_tag != LDAP_REQ_SEARCH || (META_BACK_ONERR_STOP( mi )) || # 698| (asyncmeta_is_last_result(mc, bc, candidate) == 0)) { # 699|-> LDAP_STAILQ_REMOVE(&mc->mc_om_list, bc, bm_context_t, bc_next); # 700| bc->op->o_threadctx = ctx; # 701| bc->op->o_tid = ldap_pvt_thread_pool_tid( ctx ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:928:5: warning[deadcode.DeadStores]: Value stored to 'sres' is never read # 926| if ( rs->sr_err != LDAP_SUCCESS ) { # 927| candidates[ i ].sr_err = rs->sr_err; # 928|-> sres = slap_map_api2result( &candidates[ i ] ); # 929| candidates[ i ].sr_type = REP_RESULT; # 930| goto finish; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:1683:5: warning[core.NullDereference]: Dereference of null pointer # 1681| operation_counter_init( op, ctx ); # 1682| # 1683|-> LDAP_STAILQ_REMOVE(&mc->mc_om_list, bc, bm_context_t, bc_next); # 1684| mc->pending_ops--; # 1685| for (j=0; j<mi->mi_ntargets; j++) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:1700:5: warning[core.NullDereference]: Dereference of null pointer # 1698| } # 1699| if (bc->bc_invalid) { # 1700|-> LDAP_STAILQ_REMOVE(&mc->mc_om_list, bc, bm_context_t, bc_next); # 1701| mc->pending_ops--; # 1702| LDAP_STAILQ_INSERT_TAIL( &timeout_list, bc, bc_next); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:1708:5: warning[core.NullDereference]: Dereference of null pointer # 1706| if (bc->timeout && bc->stoptime < current_time) { # 1707| Operation *op = bc->op; # 1708|-> LDAP_STAILQ_REMOVE(&mc->mc_om_list, bc, bm_context_t, bc_next); # 1709| mc->pending_ops--; # 1710| LDAP_STAILQ_INSERT_TAIL( &timeout_list, bc, bc_next); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modify.c:235:8: warning[deadcode.DeadStores]: Value stored to 'thrctx' during its initialization is never read # 233| a_metaconn_t *mc; # 234| int rc, candidate = -1; # 235|-> void *thrctx = op->o_threadctx; # 236| bm_context_t *bc; # 237| SlapReply *candidates; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modify.c: scope_hint: In function ‘asyncmeta_back_modify’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modify.c:235:15: warning[-Wunused-variable]: unused variable ‘thrctx’ # 235 | void *thrctx = op->o_threadctx; # | ^~~~~~ # 233| a_metaconn_t *mc; # 234| int rc, candidate = -1; # 235|-> void *thrctx = op->o_threadctx; # 236| bm_context_t *bc; # 237| SlapReply *candidates; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modrdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modrdn.c:249:8: warning[deadcode.DeadStores]: Value stored to 'thrctx' during its initialization is never read # 247| a_metaconn_t *mc; # 248| int rc, candidate = -1; # 249|-> void *thrctx = op->o_threadctx; # 250| bm_context_t *bc; # 251| SlapReply *candidates; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modrdn.c: scope_hint: In function ‘asyncmeta_back_modrdn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/modrdn.c:249:15: warning[-Wunused-variable]: unused variable ‘thrctx’ # 249 | void *thrctx = op->o_threadctx; # | ^~~~~~ # 247| a_metaconn_t *mc; # 248| int rc, candidate = -1; # 249|-> void *thrctx = op->o_threadctx; # 250| bm_context_t *bc; # 251| SlapReply *candidates; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/search.c: scope_hint: In function ‘asyncmeta_back_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/search.c:681:15: warning[-Wunused-variable]: unused variable ‘thrctx’ # 681 | void *thrctx = op->o_threadctx; # | ^~~~~~ # 679| long i; # 680| SlapReply *candidates = NULL; # 681|-> void *thrctx = op->o_threadctx; # 682| bm_context_t *bc; # 683| a_metaconn_t *mc; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_asyncmeta 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:112:24: warning[core.NullDereference]: Dereference of null pointer # 110| "%s DNSSRV p=%d dn=\"%s\" url=\"%s\"\n", # 111| op->o_log_prefix, op->o_protocol, # 112|-> op->o_req_dn.bv_val, urls[0].bv_val ); # 113| # 114| Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> url=\"%s\"\n", Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/referral.c:115:24: warning[core.NullDereference]: Dereference of null pointer # 113| # 114| Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> url=\"%s\"\n", # 115|-> op->o_req_dn.bv_val, urls[0].bv_val ); # 116| # 117| rs->sr_ref = urls; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/search.c:122:51: warning[core.NullDereference]: Dereference of null pointer # 120| "%s DNSSRV p=%d dn=\"%s\" url=\"%s\"\n", # 121| op->o_log_prefix, op->o_protocol, # 122|-> op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "", urls[0].bv_val ); # 123| # 124| Debug( LDAP_DEBUG_TRACE, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/search.c:128:3: warning[core.NullDereference]: Dereference of null pointer # 126| op->oq_search.rs_scope, # 127| op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "", # 128|-> urls[0].bv_val ); # 129| # 130| rc = ldap_domain2dn(domain, &refdn); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-dnssrv/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_dnssrv 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:31: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c: scope_hint: In function ‘asyncmeta_op_handle_result’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:111:42: warning[-Wmaybe-uninitialized]: ‘msc’ may be used uninitialized # 111 | #define LDAP_BACK_CONN_ISSET_F(fp,f) (*(fp) & (f)) # | ^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-asyncmeta/meta_result.c:1486:29: note: ‘msc’ was declared here # 1486 | a_metasingleconn_t *msc; # | ^~~ # 109| # 110| unsigned lc_lcflags; # 111|-> #define LDAP_BACK_CONN_ISSET_F(fp,f) (*(fp) & (f)) # 112| #define LDAP_BACK_CONN_SET_F(fp,f) (*(fp) |= (f)) # 113| #define LDAP_BACK_CONN_CLEAR_F(fp,f) (*(fp) &= ~(f)) Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c: scope_hint: In function ‘meta_back_getconn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:112:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘metaconn_alloc(op)’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:124:41: note: in expansion of macro ‘LDAP_BACK_CONN_SET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:150:49: note: in expansion of macro ‘LDAP_BACK_CONN_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1294:33: note: in expansion of macro ‘LDAP_BACK_CONN_ISPRIV_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1102:17: note: in expansion of macro ‘LDAP_BACK_PCONN_ROOTDN_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_queue.h:394:34: note: in definition of macro ‘LDAP_TAILQ_FIRST’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1136:25: note: in expansion of macro ‘LDAP_TAILQ_FOREACH’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1137:52: note: in expansion of macro ‘LDAP_BACK_CONN2PRIV’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:340:46: note: in definition of macro ‘LDAP_BACK_ISSET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/back-meta.h:449:33: note: in expansion of macro ‘mi_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:343:66: note: in expansion of macro ‘li_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:362:41: note: in expansion of macro ‘LDAP_BACK_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1157:38: note: in expansion of macro ‘LDAP_BACK_USE_TEMPORARIES’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1287:47: note: in expansion of macro ‘mc_conn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:123:41: note: in expansion of macro ‘LDAP_BACK_CONN_ISSET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:149:49: note: in expansion of macro ‘LDAP_BACK_CONN_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1293:30: note: in expansion of macro ‘LDAP_BACK_CONN_ISPRIV’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:124:41: note: in expansion of macro ‘LDAP_BACK_CONN_SET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:150:49: note: in expansion of macro ‘LDAP_BACK_CONN_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1294:33: note: in expansion of macro ‘LDAP_BACK_CONN_ISPRIV_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:124:41: note: in expansion of macro ‘LDAP_BACK_CONN_SET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:150:49: note: in expansion of macro ‘LDAP_BACK_CONN_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1294:33: note: in expansion of macro ‘LDAP_BACK_CONN_ISPRIV_SET’ # 110| unsigned lc_lcflags; # 111| #define LDAP_BACK_CONN_ISSET_F(fp,f) (*(fp) & (f)) # 112|-> #define LDAP_BACK_CONN_SET_F(fp,f) (*(fp) |= (f)) # 113| #define LDAP_BACK_CONN_CLEAR_F(fp,f) (*(fp) &= ~(f)) # 114| #define LDAP_BACK_CONN_CPY_F(fp,f,mfp) \ Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/bind.c:1369: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1367| cb.sc_private = &o_tag; # 1368| cb.sc_response = ldap_back_dobind_cb; # 1369|-> op->o_callback = &cb; # 1370| # 1371| if ( LDAP_BACK_CONN_ISIDASSERT( lc ) ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:1029: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1027| db = *op->o_bd; # 1028| SLAP_DBFLAGS( &db ) &= ~SLAP_DBFLAG_MONITORING; # 1029|-> op->o_bd = &db; # 1030| # 1031| text = rs->sr_text; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:1046: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1044| sc2.sc_private = &lb; # 1045| sc2.sc_response = ldap_chain_cb_response; # 1046|-> op->o_callback = &sc2; # 1047| # 1048| /* Chaining can be performed by a privileged user on behalf Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:1260:33: warning[-Wmissing-braces]: missing braces around initializer # 1260 | static ConfigTable chaincfg[] = { # | ^ # 1258| #endif # 1259| # 1260|-> static ConfigTable chaincfg[] = { # 1261| #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR # 1262| { "chain-chaining", "args", Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c: scope_hint: In function ‘ldap_chain_db_init_common’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2062:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘li’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:23: included_from: Included from here. # 2060| } # 2061| li = (ldapinfo_t *)be->be_private; # 2062|-> li->li_urllist_f = NULL; # 2063| li->li_urllist_p = NULL; # 2064| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c: scope_hint: In function ‘ldap_chain_db_init_one’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2097:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘li’ # 2095| } # 2096| li = (ldapinfo_t *)be->be_private; # 2097|-> li->li_urllist_f = NULL; # 2098| li->li_urllist_p = NULL; # 2099| Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2179: warning[uninitvar]: Uninitialized variable: rc # 2177| be->be_private = private; # 2178| # 2179|-> return rc; # 2180| } # 2181| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2179:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 2177| be->be_private = private; # 2178| # 2179|-> return rc; # 2180| } # 2181| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c: scope_hint: In function ‘ldap_chain_connection_destroy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2179:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘rc’ # 2177| be->be_private = private; # 2178| # 2179|-> return rc; # 2180| } # 2181| Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c: scope_hint: In function ‘ldap_chain_connection_destroy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2179:16: warning[-Wmaybe-uninitialized]: ‘rc’ may be used uninitialized # 2179 | return rc; # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/chain.c:2159:33: note: ‘rc’ was declared here # 2159 | int rc; # | ^~ # 2177| be->be_private = private; # 2178| # 2179|-> return rc; # 2180| } # 2181| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c:77:32: warning[-Wmissing-braces]: missing braces around initializer # 77 | static ConfigTable ldapcfg[] = { # | ^ # 75| }; # 76| # 77|-> static ConfigTable ldapcfg[] = { # 78| { "uri", "uri", 2, 2, 0, # 79| ARG_MAGIC|LDAP_BACK_CFG_URI, Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c:363:33: warning[-Wmissing-braces]: missing braces around initializer # 363 | static ConfigTable pbindcfg[] = { # | ^ # 361| }; # 362| # 363|-> static ConfigTable pbindcfg[] = { # 364| { "uri", "uri", 2, 2, 0, # 365| ARG_MAGIC|LDAP_BACK_CFG_URI, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c:1045:5: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 1043| ptr = bv.bv_val; # 1044| ptr = lutil_strcopy( ptr, buf ); # 1045|-> ptr = lutil_strncopy( ptr, ((*bvp)[ i ]).bv_val, ((*bvp)[ i ]).bv_len ); # 1046| value_add_one( &c->rvalue_vals, &bv ); # 1047| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c:1085:7: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 1083| # 1084| ptr = lutil_strcopy( bv.bv_val, "mode=" ); # 1085|-> ptr = lutil_strcopy( ptr, mode.bv_val ); # 1086| } # 1087| break; Error: GCC_ANALYZER_WARNING (CWE-465): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c: scope_hint: In function ‘ldap_back_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/config.c:1688:20: warning[-Wanalyzer-deref-before-check]: check of ‘ch_calloc(8, (long unsigned int)(i + 1))’ for NULL after already dereferencing it # 1686| # 1687| done_url:; # 1688|-> if ( urllist ) { # 1689| ldap_charray_free( urllist ); # 1690| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/delete.c:61:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 59| rs->sr_err = ldap_delete_ext( lc->lc_ld, op->o_req_dn.bv_val, # 60| ctrls, NULL, &msgid ); # 61|-> rc = ldap_back_op_result( lc, op, rs, msgid, # 62| li->li_timeout[ SLAP_OP_DELETE ], # 63| ( LDAP_BACK_SENDRESULT | retrying ) ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:326:37: warning[-Wmissing-braces]: missing braces around initializer # 326 | static ConfigTable distproc_cfg[] = { # | ^ # 324| static ConfigLDAPadd distproc_ldadd; # 325| # 326|-> static ConfigTable distproc_cfg[] = { # 327| { "distproc-chaining", "args", # 328| 2, 4, 0, ARG_MAGIC|ARG_BERVAL|DP_CHAINING, distproc_cfgen, Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c: scope_hint: In function ‘distproc_cfadd’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:497:49: warning[-Wunused-but-set-variable]: variable ‘lca’ set but not used # 497 | ldap_distproc_cfadd_apply_t lca = { 0 }; # | ^~~ # 495| # 496| if ( lback->bi_cf_ocs ) { # 497|-> ldap_distproc_cfadd_apply_t lca = { 0 }; # 498| # 499| lca.op = op; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c: scope_hint: In function ‘ldap_distproc_db_init_one’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:841:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘li’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:23: included_from: Included from here. # 839| # 840| /* copy common data */ # 841|-> li->li_nretries = lc->lc_common_li->li_nretries; # 842| li->li_flags = lc->lc_common_li->li_flags; # 843| li->li_version = lc->lc_common_li->li_version; Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:880: warning[uninitvar]: Uninitialized variable: rc # 878| be->be_private = private; # 879| # 880|-> return rc; # 881| } # 882| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:880:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 878| be->be_private = private; # 879| # 880|-> return rc; # 881| } # 882| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c: scope_hint: In function ‘ldap_distproc_connection_destroy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:880:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘rc’ # 878| be->be_private = private; # 879| # 880|-> return rc; # 881| } # 882| Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c: scope_hint: In function ‘ldap_distproc_connection_destroy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:880:16: warning[-Wmaybe-uninitialized]: ‘rc’ may be used uninitialized # 880 | return rc; # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/distproc.c:861:33: note: ‘rc’ was declared here # 861 | int rc; # | ^~ # 878| be->be_private = private; # 879| # 880|-> return rc; # 881| } # 882| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/extended.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-704): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/extended.c: scope_hint: In function ‘ldap_back_exop_passwd’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/extended.c:245:27: warning[-Wdiscarded-qualifiers]: passing argument 1 of ‘strcpy’ discards ‘const’ qualifier from pointer target type # 245 | strcpy( rs->sr_text, text ); # | ~~^~~~~~~~~ /usr/include/features.h:511: included_from: Included from here. /usr/include/bits/types.h:26: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/fdset.h:32: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1179: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/extended.c:22: included_from: Included from here. /usr/include/bits/string_fortified.h:77:16: note: expected ‘char *’ but argument is of type ‘const char *’ # 77 | __NTH (strcpy (__fortify_clang_overload_arg (char *, __restrict, __dest), # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 243| /* copy to tmpmem, doesn't need to be freed */ # 244| rs->sr_text = op->o_tmpalloc( strlen( text ) + 1, op->o_tmpmemctx ); # 245|-> strcpy( rs->sr_text, text ); # 246| ch_free( text ); # 247| } Error: COMPILER_WARNING (CWE-704): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/extended.c: scope_hint: In function ‘ldap_back_exop_generic’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/extended.c:372:27: warning[-Wdiscarded-qualifiers]: passing argument 1 of ‘strcpy’ discards ‘const’ qualifier from pointer target type # 372 | strcpy( rs->sr_text, text ); # | ~~^~~~~~~~~ /usr/include/bits/string_fortified.h:77:16: note: expected ‘char *’ but argument is of type ‘const char *’ # 77 | __NTH (strcpy (__fortify_clang_overload_arg (char *, __restrict, __dest), # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 370| /* copy to tmpmem, doesn't need to be freed */ # 371| rs->sr_text = op->o_tmpalloc( strlen( text ) + 1, op->o_tmpmemctx ); # 372|-> strcpy( rs->sr_text, text ); # 373| ch_free( text ); # 374| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/modify.c:61:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 59| + i*sizeof( LDAPMod ) ); # 60| if ( modv == NULL ) { # 61|-> rc = LDAP_NO_MEMORY; # 62| goto cleanup; # 63| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/modify.c:106:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 104| rs->sr_err = ldap_modify_ext( lc->lc_ld, op->o_req_dn.bv_val, modv, # 105| ctrls, NULL, &msgid ); # 106|-> rc = ldap_back_op_result( lc, op, rs, msgid, # 107| li->li_timeout[ SLAP_OP_MODIFY ], # 108| ( LDAP_BACK_SENDRESULT | retrying ) ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/modify.c:125:15: warning[core.NullDereference]: Array access (from variable 'modv') results in a null pointer dereference # 123| (void)ldap_back_controls_free( op, rs, &ctrls ); # 124| # 125|-> for ( i = 0; modv[ i ]; i++ ) { # 126| ch_free( modv[ i ]->mod_bvalues ); # 127| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/modrdn.c:94:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 92| newrdn.bv_val, newSup, # 93| op->orr_deleteoldrdn, ctrls, NULL, &msgid ); # 94|-> rc = ldap_back_op_result( lc, op, rs, msgid, # 95| li->li_timeout[ SLAP_OP_MODRDN ], # 96| ( LDAP_BACK_SENDRESULT | retrying ) ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/monitor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/monitor.c: scope_hint: In function ‘ldap_back_monitor_db_close’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/monitor.c:1040:42: warning[-Wunused-but-set-variable]: variable ‘mbe’ set but not used # 1040 | monitor_extra_t *mbe; # | ^~~ # 1038| if ( li && !BER_BVISNULL( &li->li_monitor_info.lmi_ndn ) ) { # 1039| BackendInfo *mi; # 1040|-> monitor_extra_t *mbe; # 1041| # 1042| /* check if monitor is configured and usable */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/monitor.c:1045:5: warning[deadcode.DeadStores]: Value stored to 'mbe' is never read # 1043| mi = backend_info( "monitor" ); # 1044| if ( mi && mi->bi_extra ) { # 1045|-> mbe = mi->bi_extra; # 1046| # 1047| /*TODO Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_ldap 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/ldif.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/ldif.c:166:32: warning[-Wmissing-braces]: missing braces around initializer # 166 | static ConfigTable ldifcfg[] = { # | ^ # 164| # 165| # 166|-> static ConfigTable ldifcfg[] = { # 167| { "directory", "dir", 2, 2, 0, ARG_BERVAL|ARG_OFFSET, # 168| (void *)offsetof(struct ldif_info, li_base_path), Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/ldif.c:1457: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1455| send_res: # 1456| rs->sr_err = rc; # 1457|-> if ( num_ctrls ) rs->sr_ctrls = ctrls; # 1458| Debug( LDAP_DEBUG_TRACE, "ldif_back_add: err: %d text: %s\n", # 1459| rc, rs->sr_text ? rs->sr_text : "" ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/ldif.c:1503:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1501| /* FIXME: is it correct to abort # 1502| * operation if control fails? */ # 1503|-> rc = rs->sr_err; # 1504| } # 1505| } Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/ldif.c:1542: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1540| # 1541| rs->sr_err = rc; # 1542|-> if ( num_ctrls ) rs->sr_ctrls = ctrls; # 1543| send_ldap_result( op, rs ); # 1544| slap_graduate_commit_csn( op ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/ldif.c:1646: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1644| ldap_pvt_thread_mutex_unlock( &li->li_modop_mutex ); # 1645| rs->sr_err = rc; # 1646|-> if ( num_ctrls ) rs->sr_ctrls = ctrls; # 1647| send_ldap_result( op, rs ); # 1648| slap_graduate_commit_csn( op ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldif/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_ldif 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c: scope_hint: In function ‘ainfo_insert’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:73:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:24: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:332:21: note: in expansion of macro ‘IS_SLAP_INDEX’ # 71| mdb->mi_attrs = ch_realloc( mdb->mi_attrs, ( mdb->mi_nattrs+1 ) * # 72| sizeof( AttrInfo * )); # 73|-> if ( x < mdb->mi_nattrs ) # 74| AC_MEMCPY( &mdb->mi_attrs[x+1], &mdb->mi_attrs[x], # 75| ( mdb->mi_nattrs - x ) * sizeof( AttrInfo *)); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:163:10: warning[core.NullDereference]: Array access (from variable 'dbis') results in a null pointer dereference # 161| if ( rc ) { # 162| for ( i=0; i<mdb->mi_nattrs; i++ ) { # 163|-> if ( dbis[i] ) { # 164| mdb->mi_attrs[i]->ai_dbi = 0; # 165| mdb->mi_attrs[i]->ai_indexmask |= MDB_INDEX_DELETING; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c: scope_hint: In function ‘mdb_attr_index_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:432:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:332:21: note: in expansion of macro ‘IS_SLAP_INDEX’ # 430| AttrInfo *b = mdb_attr_mask( mdb, ad ); # 431| /* If this is just a multival record, reuse it for index info */ # 432|-> if ( !( b->ai_indexmask || b->ai_newmask ) && b->ai_multi_lo < UINT_MAX ) { # 433| b->ai_indexmask = a->ai_indexmask; # 434| b->ai_newmask = a->ai_newmask; Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c: scope_hint: In function ‘mdb_attr_multi_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:581:1: warning[-Wunused-label]: label ‘fail’ defined but not used # 581 | fail: # | ^~~~ # 579| fname, lineno, c_reply->msg ); # 580| } # 581|-> fail: # 582| goto done; # 583| } Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c: scope_hint: In function ‘mdb_attr_multi_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:595:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 593| AttrInfo *b = mdb_attr_mask( mdb, ad ); # 594| /* If this is just an index record, reuse it for multival info */ # 595|-> if ( b->ai_multi_lo == UINT_MAX ) { # 596| b->ai_multi_hi = a->ai_multi_hi; # 597| b->ai_multi_lo = a->ai_multi_lo; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:763:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 761| rc = slap_bv2ad( &bdata, &ad, &text ); # 762| if ( rc ) { # 763|-> rc = slap_bv2undef_ad( &bdata, &mdb->mi_ads[i], &text, 0 ); # 764| } else { # 765| if ( ad->ad_index >= MDB_MAXADS ) { Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c: scope_hint: In function ‘mdb_ad_read’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/attr.c:778:1: warning[-Wunused-label]: label ‘done’ defined but not used # 778 | done: # | ^~~~ # 776| mdb->mi_numads = i-1; # 777| # 778|-> done: # 779| if ( rc == MDB_NOTFOUND ) # 780| rc = 0; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:50:31: warning[-Wmissing-braces]: missing braces around initializer # 50 | static ConfigTable mdbcfg[] = { # | ^ # 48| }; # 49| # 50|-> static ConfigTable mdbcfg[] = { # 51| { "idlexp", "log", 2, 2, 0, ARG_UINT|ARG_MAGIC|MDB_IDLEXP, # 52| mdb_bk_cfg, "( OLcfgBkAt:12.1 NAME 'olcBkMdbIdlExp' " Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:270:4: warning[deadcode.DeadStores]: Value stored to 'getnext' is never read # 268| } # 269| if ( getnext ) { # 270|-> getnext = 0; # 271| key.mv_data = &id; # 272| rc = mdb_cursor_get( curs, &key, &data, MDB_SET_RANGE ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:276:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 274| mdb_txn_abort( txn ); # 275| if ( rc == MDB_NOTFOUND ) # 276|-> rc = 0; # 277| break; # 278| } Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:412: error[invalidLifetime]: Using object that points to local variable 'mask' that is out of scope. # 410| ID id = 0; # 411| s = 0; /* key 0 records next entryID to index */ # 412|-> data.mv_size = sizeof( ID ); # 413| data.mv_data = &id; # 414| rc = mdb_cursor_put( curs, &key, &data, 0 ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:444:10: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc' # 442| return 0; # 443| # 444|-> while(( rc = mdb_cursor_get( curs, &key, &data, MDB_NEXT )) == 0) { # 445| s = key.mv_data; # 446| if ( !*s ) Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c: scope_hint: In function ‘mdb_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:883:68: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 4123 bytes into a region of size 256 # 883 | snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: invalid path: %s", # | ^~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 17 and 4267 bytes into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 881| char ebuf[128]; # 882| int saved_errno = errno; # 883|-> snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: invalid path: %s", # 884| c->log, AC_STRERROR_R( saved_errno, ebuf, sizeof(ebuf) ) ); # 885| Debug( LDAP_DEBUG_ANY, "%s\n", c->cr_msg ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/config.c:919:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 917| mdb->mi_flags |= MDB_RE_OPEN; # 918| config_push_cleanup( c, mdb_cf_cleanup ); # 919|-> rc = 0; # 920| } # 921| mdb->mi_dbenv_flags |= mdb_envflags[j].mask; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/delete.c:151:31: warning[core.NullDereference]: Dereference of null pointer # 149| op->o_req_dn.bv_val ); # 150| # 151|-> rs->sr_matched = ch_strdup( e->e_dn ); # 152| if ( is_entry_referral( e )) { # 153| BerVarray ref = get_entry_referrals( op, e ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2entry.c:56:5: warning[deadcode.DeadStores]: Value stored to 'rc2' is never read # 54| rc2 = mdb_cursor_open( tid, mdb->mi_id2entry, &mc ); # 55| if ( rc2 == MDB_SUCCESS ) { # 56|-> rc2 = mdb_id2entry( op, mc, id, e ); # 57| mdb_cursor_close( mc ); # 58| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c: scope_hint: In function ‘mdb_dn2id’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:315:33: warning[-Wdangling-pointer=]: storing the address of local variable ‘dn’ in ‘matched_134(D)->bv_val’ # 315 | *matched->bv_val-- = '\0'; # | ~~~~~~~~~~~~~~~^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:306:14: note: ‘dn’ declared here # 306 | char dn[SLAP_LDAPDN_MAXLEN]; # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:296:26: note: ‘matched’ declared here # 296 | struct berval *matched, # | ~~~~~~~~~~~~~~~~~^~~~~~~ # 313| matched->bv_val = dn + sizeof(dn) - 1; # 314| matched->bv_len = 0; # 315|-> *matched->bv_val-- = '\0'; # 316| } # 317| if ( nmatched ) { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:563:29: warning[-Wunused-but-set-variable]: variable ‘len’ set but not used # 563 | int rc, len, nlen; # | ^~~ # 561| MDB_val key, data; # 562| MDB_cursor *cursor; # 563|-> int rc, len, nlen; # 564| char dn[SLAP_LDAPDN_MAXLEN], ndn[SLAP_LDAPDN_MAXLEN], *ptr; # 565| char *dptr, *nptr; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c: scope_hint: In function ‘mdb_id2name’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:563:34: warning[-Wunused-but-set-variable]: variable ‘nlen’ set but not used # 563 | int rc, len, nlen; # | ^~~~ # 561| MDB_val key, data; # 562| MDB_cursor *cursor; # 563|-> int rc, len, nlen; # 564| char dn[SLAP_LDAPDN_MAXLEN], ndn[SLAP_LDAPDN_MAXLEN], *ptr; # 565| char *dptr, *nptr; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:576:2: warning[deadcode.DeadStores]: Value stored to 'len' is never read # 574| cursor = *cursp; # 575| # 576|-> len = 0; # 577| nlen = 0; # 578| dptr = dn; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:577:2: warning[deadcode.DeadStores]: Value stored to 'nlen' is never read # 575| # 576| len = 0; # 577|-> nlen = 0; # 578| dptr = dn; # 579| nptr = ndn; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:604:10: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 602| dptr += rlen; # 603| } # 604|-> if ( rc == 0 ) { # 605| name->bv_len = dptr - dn; # 606| nname->bv_len = nptr - ndn; Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:609: error[uninitvar]: Uninitialized variable: dn # 607| name->bv_val = op->o_tmpalloc( name->bv_len + 1, op->o_tmpmemctx ); # 608| nname->bv_val = op->o_tmpalloc( nname->bv_len + 1, op->o_tmpmemctx ); # 609|-> memcpy( name->bv_val, dn, name->bv_len ); # 610| name->bv_val[name->bv_len] = '\0'; # 611| memcpy( nname->bv_val, ndn, nname->bv_len ); Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/dn2id.c:611: error[uninitvar]: Uninitialized variable: ndn # 609| memcpy( name->bv_val, dn, name->bv_len ); # 610| name->bv_val[name->bv_len] = '\0'; # 611|-> memcpy( nname->bv_val, ndn, nname->bv_len ); # 612| nname->bv_val[nname->bv_len] = '\0'; # 613| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/filterindex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/filterindex.c: scope_hint: In function ‘ext_candidates’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/filterindex.c:525:29: warning[-Wunused-but-set-variable]: variable ‘scope’ set but not used # 525 | int scope; # | ^~~~~ # 523| dnRelativeMatch && dnIsSuffix( &mra->ma_value, # 524| op->o_bd->be_nsuffix )) { # 525|-> int scope; # 526| if ( mra->ma_rule == slap_schema.si_mr_dnSuperiorMatch ) { # 527| mdb_dn2sups( op, rtxn, &mra->ma_value, ids ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/filterindex.c:531:5: warning[deadcode.DeadStores]: Value stored to 'scope' is never read # 529| } # 530| if ( mra->ma_rule == slap_schema.si_mr_dnSubtreeMatch ) # 531|-> scope = LDAP_SCOPE_SUBTREE; # 532| else if ( mra->ma_rule == slap_schema.si_mr_dnOneLevelMatch ) # 533| scope = LDAP_SCOPE_ONELEVEL; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/filterindex.c:533:5: warning[deadcode.DeadStores]: Value stored to 'scope' is never read # 531| scope = LDAP_SCOPE_SUBTREE; # 532| else if ( mra->ma_rule == slap_schema.si_mr_dnOneLevelMatch ) # 533|-> scope = LDAP_SCOPE_ONELEVEL; # 534| else if ( mra->ma_rule == slap_schema.si_mr_dnSubordinateMatch ) # 535| scope = LDAP_SCOPE_SUBORDINATE; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/filterindex.c:535:5: warning[deadcode.DeadStores]: Value stored to 'scope' is never read # 533| scope = LDAP_SCOPE_ONELEVEL; # 534| else if ( mra->ma_rule == slap_schema.si_mr_dnSubordinateMatch ) # 535|-> scope = LDAP_SCOPE_SUBORDINATE; # 536| else # 537| goto base; /* scope = LDAP_SCOPE_BASE; */ Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c: scope_hint: In function ‘mdb_id2v_compare’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:50:13: warning[-Wunused-variable]: unused variable ‘rc’ # 50 | int rc; # | ^~ # 48| unsigned short *uv, *cv; # 49| ID ui, ci; # 50|-> int rc; # 51| # 52| memcpy(&ui, usrkey->mv_data, sizeof(ID)); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:75:13: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 75 | int rc, match, olen; # | ^~ # 73| AttributeDescription *ad = usrkey[2].mv_data; # 74| struct berval bv1, bv2; # 75|-> int rc, match, olen; # 76| unsigned short s; # 77| char *ptr; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c: scope_hint: In function ‘mdb_id2v_dupsort’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:75:24: warning[-Wunused-variable]: unused variable ‘olen’ # 75 | int rc, match, olen; # | ^~~~ # 73| AttributeDescription *ad = usrkey[2].mv_data; # 74| struct berval bv1, bv2; # 75|-> int rc, match, olen; # 76| unsigned short s; # 77| char *ptr; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:91:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 89| if (ad && ad->ad_type->sat_equality) { # 90| MatchingRule *mr = ad->ad_type->sat_equality; # 91|-> rc = mr->smr_match(&match, SLAP_MR_EQUALITY # 92| | SLAP_MR_VALUE_OF_ASSERTION_SYNTAX # 93| | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c: scope_hint: In function ‘mdb_mval_del’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:166:15: warning[-Wunused-variable]: unused variable ‘ptr’ # 166 | char *ptr; # | ^~~ # 164| struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private; # 165| MDB_val key, data[3]; # 166|-> char *ptr; # 167| char ivk[ID2VKSZ]; # 168| unsigned i; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c: scope_hint: In function ‘mdb_opinfo_get’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:754:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘moi’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:17: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:57: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/back-mdb.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:23: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:721:17: note: in expansion of macro ‘LDAP_SLIST_FOREACH’ # 752| *moip = moi; # 753| } # 754|-> moi->moi_ref++; # 755| if ( !moi->moi_txn ) { # 756| if (( slapMode & SLAP_TOOL_MODE ) && mdb_tool_txn ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:1059:9: warning[core.NullDereference]: Access to field 'a_vals' results in a dereference of a null pointer (loaded from variable 'a') # 1057| } # 1058| a = x->e_attrs; # 1059|-> bptr = a->a_vals; # 1060| i = *lp++; # 1061| ptr = (unsigned char *)(lp + i); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c: scope_hint: In function ‘mdb_entry_decode’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/id2entry.c:1059:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘a’ # 1057| } # 1058| a = x->e_attrs; # 1059|-> bptr = a->a_vals; # 1060| i = *lp++; # 1061| ptr = (unsigned char *)(lp + i); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/idl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/idl.c:206:12: warning[-Wunused-function]: ‘mdb_idl_delete’ defined but not used # 206 | static int mdb_idl_delete( ID *ids, ID id ) # | ^~~~~~~~~~~~~~ # 204| } # 205| # 206|-> static int mdb_idl_delete( ID *ids, ID id ) # 207| { # 208| unsigned x; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/idl.c:673:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 671| } else { # 672| /* position on lo */ # 673|-> rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT_DUP ); # 674| if ( id == lo ) # 675| data.mv_data = &lo2; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/idl.c:678:7: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 676| else { # 677| /* position on hi */ # 678|-> rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT_DUP ); # 679| data.mv_data = &hi2; # 680| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c: scope_hint: In function ‘mdb_index_param’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:84:27: warning[-Wunused-but-set-variable]: variable ‘type’ set but not used # 84 | slap_mask_t mask, type = 0; # | ^~~~ # 82| { # 83| AttrInfo *ai; # 84|-> slap_mask_t mask, type = 0; # 85| # 86| ai = mdb_index_mask( be, desc, prefixp ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:115:3: warning[deadcode.DeadStores]: Value stored to 'type' is never read # 113| switch( ftype ) { # 114| case LDAP_FILTER_PRESENT: # 115|-> type = SLAP_INDEX_PRESENT; # 116| if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) { # 117| *prefixp = presence_key[0]; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:123:3: warning[deadcode.DeadStores]: Value stored to 'type' is never read # 121| # 122| case LDAP_FILTER_APPROX: # 123|-> type = SLAP_INDEX_APPROX; # 124| if ( desc->ad_type->sat_approx ) { # 125| if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:135:3: warning[deadcode.DeadStores]: Value stored to 'type' is never read # 133| # 134| case LDAP_FILTER_EQUALITY: # 135|-> type = SLAP_INDEX_EQUALITY; # 136| if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) ) { # 137| goto done; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:142:3: warning[deadcode.DeadStores]: Value stored to 'type' is never read # 140| # 141| case LDAP_FILTER_SUBSTRINGS: # 142|-> type = SLAP_INDEX_SUBSTR; # 143| if( IS_SLAP_INDEX( mask, SLAP_INDEX_SUBSTR ) ) { # 144| goto done; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c: scope_hint: In function ‘indexer’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:179:15: warning[-Wunused-but-set-variable]: variable ‘err’ set but not used # 179 | char *err; # | ^~~ # 177| MDB_cursor *mc = ai->ai_cursor; # 178| mdb_idl_keyfunc *keyfunc; # 179|-> char *err; # 180| # 181| assert( mask != 0 ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:184:3: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 182| # 183| if ( !mc ) { # 184|-> err = "c_open"; # 185| rc = mdb_cursor_open( txn, ai->ai_dbi, &mc ); # 186| if ( rc ) goto done; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:207:4: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 205| rc = keyfunc( op->o_bd, mc, presence_key, id ); # 206| if( rc ) { # 207|-> err = "presence"; # 208| goto done; # 209| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:224:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 222| ber_bvarray_free_x( keys, op->o_tmpmemctx ); # 223| if ( rc ) { # 224|-> err = "equality"; # 225| goto done; # 226| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:243:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 241| ber_bvarray_free_x( keys, op->o_tmpmemctx ); # 242| if ( rc ) { # 243|-> err = "approx"; # 244| goto done; # 245| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/index.c:263:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 261| ber_bvarray_free_x( keys, op->o_tmpmemctx ); # 262| if( rc ) { # 263|-> err = "substr"; # 264| goto done; # 265| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/init.c:244:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 242| mdb_set_dupsort( txn, mdb->mi_dbis[i], mdb_dup_compare ); # 243| /* check for old dn2id format */ # 244|-> rc = mdb_cursor_open( txn, mdb->mi_dbis[i], &mc ); # 245| /* first record is always ID 0 */ # 246| rc = mdb_cursor_get( mc, &key, &data, MDB_FIRST ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/init.c:293:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 291| if ( slapMode & SLAP_SERVER_MODE ) { # 292| MDB_stat st; # 293|-> rc = mdb_stat( txn, mdb->mi_idxckp, &st ); # 294| if ( st.ms_entries ) # 295| do_index = mdb_resume_index( be, txn ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modify.c:469:10: warning[deadcode.DeadStores]: Value stored to 'k2' during its initialization is never read # 467| char found = 0; # 468| BerValue* current = &ap->a_nvals[i]; # 469|-> int k2 = k; # 470| for (k2 = k ; k2 < a2->a_numvals; k2 ++) { # 471| int match = -1, rc; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modify.c:671:23: warning[core.NullDereference]: Access to field 'e_ocflags' results in a dereference of a null pointer (loaded from variable 'e') # 669| } # 670| # 671|-> if ( !manageDSAit && is_entry_referral( e ) ) { # 672| /* entry is a referral, don't allow modify */ # 673| rs->sr_ref = get_entry_referrals( op, e ); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c: scope_hint: In function ‘mdb_modrdn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c:44:26: warning[-Wunused-but-set-variable]: variable ‘new_parent_dn’ set but not used # 44 | struct berval *new_parent_dn = NULL; /* np_dn, p_dn, or NULL */ # | ^~~~~~~~~~~~~ # 42| struct berval *np_dn = NULL; /* newSuperior dn */ # 43| struct berval *np_ndn = NULL; /* newSuperior ndn */ # 44|-> struct berval *new_parent_dn = NULL; /* np_dn, p_dn, or NULL */ # 45| # 46| int manageDSAit = get_manageDSAit( op ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c:91:2: warning[deadcode.DeadStores]: Value stored to 'np_ndn' is never read # 89| dnParent( &op->o_req_ndn, &p_ndn ); # 90| } # 91|-> np_ndn = &p_ndn; # 92| /* Make sure parent entry exist and we can write its # 93| * children. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c:223:22: warning[core.NullDereference]: Access to field 'e_ocflags' results in a dereference of a null pointer (loaded from variable 'e') # 221| } # 222| # 223|-> if (!manageDSAit && is_entry_referral( e ) ) { # 224| /* entry is a referral, don't allow rename */ # 225| rs->sr_ref = get_entry_referrals( op, e ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c:240:2: warning[deadcode.DeadStores]: Value stored to 'new_parent_dn' is never read # 238| } # 239| # 240|-> new_parent_dn = &p_dn; /* New Parent unless newSuperior given */ # 241| # 242| if ( op->oq_modrdn.rs_newSup != NULL ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c:268:4: warning[deadcode.DeadStores]: Value stored to 'np_dn' is never read # 266| if ( op->oq_modrdn.rs_newSup != NULL ) { # 267| if ( op->oq_modrdn.rs_newSup->bv_len ) { # 268|-> np_dn = op->oq_modrdn.rs_newSup; # 269| np_ndn = op->oq_modrdn.rs_nnewSup; # 270| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/modrdn.c:369:3: warning[deadcode.DeadStores]: Value stored to 'new_parent_dn' is never read # 367| ": wr to new parent's children OK\n" ); # 368| # 369|-> new_parent_dn = np_dn; # 370| } # 371| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c:227:13: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc' # 225| rc = mdb_cursor_open( txn, 0, &cursor ); # 226| if ( !rc ) { # 227|-> while (( rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT )) == 0 ) { # 228| iptr = data.mv_data; # 229| pages += *iptr; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c: scope_hint: In function ‘mdb_monitor_free’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c:275:28: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 275 | int i, rc; # | ^~ # 273| char textbuf[ SLAP_TEXT_BUFLEN ]; # 274| # 275|-> int i, rc; # 276| # 277| /* NOTE: if slap_shutdown != 0, priv might have already been freed */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c:288:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 286| BER_BVZERO( &values[ 1 ] ); # 287| # 288|-> rc = modify_delete_values( e, &mod, 1, &text, # 289| textbuf, sizeof( textbuf ) ); # 290| /* don't care too much about return code... */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c:297:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 295| for ( i = 0; s_at[ i ].desc != NULL; i++ ) { # 296| mod.sm_desc = *s_at[ i ].ad; # 297|-> rc = modify_delete_values( e, &mod, 1, &text, # 298| textbuf, sizeof( textbuf ) ); # 299| /* don't care too much about return code... */ Error: COMPILER_WARNING (CWE-252): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c: scope_hint: In function ‘mdb_monitor_db_open’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c:487:25: warning[-Wunused-result]: ignoring return value of ‘getcwd’ declared with attribute ‘warn_unused_result’ # 487 | getcwd( path, sizeof( path ) ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 485| if ( fname[ 0 ] != '/' ) { # 486| /* get full path name */ # 487|-> getcwd( path, sizeof( path ) ); # 488| pathlen = strlen( path ); # 489| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/monitor.c:525:3: warning[deadcode.DeadStores]: Value stored to 'next' is never read # 523| } # 524| # 525|-> next = next->a_next; # 526| } # 527| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/operational.c:115:4: warning[deadcode.DeadStores]: Value stored to 'ap' is never read # 113| assert( *ap != NULL ); # 114| # 115|-> ap = &(*ap)->a_next; # 116| } # 117| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c:177:2: warning[deadcode.DeadStores]: Value stored to 'ido' is never read # 175| # 176| cursoro = 0; # 177|-> ido = mdb_idl_first( oldsubs, &cursoro ); # 178| # 179| for (;;) { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c: scope_hint: In function ‘mdb_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c:430:26: warning[-Wunused-but-set-variable]: variable ‘attrs’ set but not used # 430 | AttributeName *attrs; # | ^~~~~ # 428| Entry *e = NULL, *base = NULL; # 429| Entry *matched = NULL; # 430|-> AttributeName *attrs; # 431| slap_mask_t mask; # 432| time_t stoptime; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c:445:2: warning[deadcode.DeadStores]: Value stored to 'attrs' is never read # 443| # 444| Debug( LDAP_DEBUG_TRACE, "=> " LDAP_XSTRING(mdb_search) "\n" ); # 445|-> attrs = op->oq_search.rs_attrs; # 446| # 447| manageDSAit = get_manageDSAit( op ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c:1180:51: warning[-Wmaybe-uninitialized]: ‘cscope’ may be used uninitialized # 1180 | while (iscopes[0] && cscope < iscopes[0]) { # | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/search.c:423:51: note: ‘cscope’ was declared here # 423 | ID id, cursor, nsubs, ncand, cscope; # | ^~~~~~ # 1178| * alias scopes left, search them too. # 1179| */ # 1180|-> while (iscopes[0] && cscope < iscopes[0]) { # 1181| cscope++; # 1182| isc.id = iscopes[cscope]; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/tools.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/tools.c:231:28: warning[core.NullDereference]: Access to field 'mi_dbenv' results in a dereference of a null pointer (loaded from variable 'mdb') # 229| struct mdb_info *mdb = be->be_private; # 230| if ( !txi ) { # 231|-> int rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txi ); # 232| if( rc != 0 ) { # 233| Debug( LDAP_DEBUG_ANY, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/tools.c:240:18: warning[core.NullDereference]: Array access (via field 'mi_dbis') results in a null pointer dereference # 238| } # 239| } # 240|-> mdb_drop( txi, mdb->mi_idxckp, 0 ); # 241| } # 242| if( txi ) { Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/tools.c:1253:1: warning[-Wunused-function]: ‘mdb_tool_index_task’ defined but not used # 1253 | mdb_tool_index_task( void *ctx, void *ptr ) # | ^~~~~~~~~~~~~~~~~~~ # 1251| # 1252| static void * # 1253|-> mdb_tool_index_task( void *ctx, void *ptr ) # 1254| { # 1255| int base = *(int *)ptr; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/tools.c:1628:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1626| } # 1627| if (dkids > 1) { # 1628|-> rc = mdb_cursor_get(mc, &key, &data, MDB_NEXT_DUP); # 1629| down: # 1630| ptr = (unsigned char *)data.mv_data + data.mv_size - sizeof(ID); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-mdb/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_mdb 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:36: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/back-meta.h:281:57: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/back-meta.h:282:49: note: in expansion of macro ‘META_BACK_CMN_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2592:22: note: in expansion of macro ‘META_BACK_CMN_QUARANTINE’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/back-meta.h:282:49: note: in expansion of macro ‘META_BACK_CMN_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2592:22: note: in expansion of macro ‘META_BACK_CMN_QUARANTINE’ # 279| # 280| unsigned mc_flags; # 281|-> #define META_BACK_CMN_ISSET(mc,f) ( ( (mc)->mc_flags & (f) ) == (f) ) # 282| #define META_BACK_CMN_QUARANTINE(mc) META_BACK_CMN_ISSET( (mc), LDAP_BACK_F_QUARANTINE ) # 283| #define META_BACK_CMN_CHASE_REFERRALS(mc) META_BACK_CMN_ISSET( (mc), LDAP_BACK_F_CHASE_REFERRALS ) Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/candidates.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/candidates.c:58:17: warning[deadcode.DeadStores]: Value stored to 'ms' during its initialization is never read # 56| meta_subtree_match( metatarget_t *mt, struct berval *ndn, int scope ) # 57| { # 58|-> metasubtree_t *ms = mt->mt_subtree; # 59| # 60| for ( ms = mt->mt_subtree; ms; ms = ms->ms_next ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/compare.c:68:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 66| switch ( ldap_back_dn_massage( &dc, &op->o_req_dn, &mdn ) ) { # 67| case LDAP_UNWILLING_TO_PERFORM: # 68|-> rc = 1; # 69| goto cleanup; # 70| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/compare.c:105:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 103| { # 104| case LDAP_UNWILLING_TO_PERFORM: # 105|-> rc = 1; # 106| goto cleanup; # 107| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:110:32: warning[-Wmissing-braces]: missing braces around initializer # 110 | static ConfigTable metacfg[] = { # | ^ # 108| }; # 109| # 110|-> static ConfigTable metacfg[] = { # 111| { "uri", "uri", 2, 0, 0, # 112| ARG_MAGIC|LDAP_BACK_CFG_URI, Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: scope_hint: In function ‘meta_subtree_unparse’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:741:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:23: included_from: Included from here. # 739| struct berval bv, *style; # 740| # 741|-> if ( !mt->mt_subtree ) # 742| return 1; # 743| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: scope_hint: In function ‘meta_subtree_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:778:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 776| # 777| if ( c->type == LDAP_BACK_CFG_SUBTREE_EX ) { # 778|-> if ( mt->mt_subtree && !mt->mt_subtree_exclude ) { # 779| snprintf( c->cr_msg, sizeof(c->cr_msg), # 780| "\"subtree-exclude\" incompatible with previous \"subtree-include\" directives" ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:787:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 785| # 786| } else { # 787|-> if ( mt->mt_subtree && mt->mt_subtree_exclude ) { # 788| snprintf( c->cr_msg, sizeof(c->cr_msg), # 789| "\"subtree-include\" incompatible with previous \"subtree-exclude\" directives" ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: scope_hint: In function ‘meta_subtree_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:878:75: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 878 | "regular expression \"%s\" bad because of %s", # | ^~ # 879 | pattern, regerr ); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 876| # 877| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 878|-> "regular expression \"%s\" bad because of %s", # 879| pattern, regerr ); # 880| ch_free( ms ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: scope_hint: In function ‘meta_back_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1372:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1370| /* target attrs */ # 1371| case LDAP_BACK_CFG_URI: { # 1372|-> char *p2, *p1 = strchr( mt->mt_uri, ' ' ); # 1373| bv.bv_len = strlen( mt->mt_uri ) + 3 + mt->mt_psuffix.bv_len; # 1374| bv.bv_val = ch_malloc( bv.bv_len + 1 ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1398:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1396| # 1397| bvp = &mt->mt_idassert_authz; # 1398|-> if ( *bvp == NULL ) { # 1399| if ( mt->mt_idassert_flags & LDAP_BACK_AUTH_AUTHZ_ALL ) # 1400| { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1594:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1592| # 1593| case LDAP_BACK_CFG_FILTER: # 1594|-> if ( mt->mt_filter == NULL ) { # 1595| rc = 1; # 1596| } else { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1746:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1744| /* target attrs */ # 1745| case LDAP_BACK_CFG_URI: # 1746|-> if ( mt->mt_uri ) { # 1747| ch_free( mt->mt_uri ); # 1748| mt->mt_uri = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1760:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1758| bvp = &mt->mt_idassert_authz; # 1759| if ( c->valx < 0 ) { # 1760|-> if ( *bvp != NULL ) { # 1761| ber_bvarray_free( *bvp ); # 1762| *bvp = NULL; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1766:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1764| # 1765| } else { # 1766|-> if ( *bvp == NULL ) { # 1767| rc = 1; # 1768| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1865:73: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1863| case LDAP_BACK_CFG_SUBTREE_IN: # 1864| /* can only be one of exclude or include */ # 1865|-> if (( c->type == LDAP_BACK_CFG_SUBTREE_EX ) ^ mt->mt_subtree_exclude ) { # 1866| rc = 1; # 1867| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1890:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1888| case LDAP_BACK_CFG_FILTER: # 1889| if ( c->valx < 0 ) { # 1890|-> meta_filter_destroy( mt->mt_filter ); # 1891| mt->mt_filter = NULL; # 1892| } else { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1894:70: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mt’ # 1892| } else { # 1893| metafilter_t *mf, **mprev; # 1894|-> for (i=0, mprev = &mt->mt_filter, mf = *mprev; mf; mf = *mprev) { # 1895| if ( i == c->valx ) { # 1896| *mprev = mf->mf_next; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2154:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘mt’ # 2152| case LDAP_BACK_CFG_SUBTREE_IN: # 2153| /* subtree-exclude */ # 2154|-> if ( meta_subtree_config( mt, c )) { # 2155| Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg ); # 2156| return 1; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: scope_hint: In function ‘meta_back_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2168:75: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 219 # 2168 | "regular expression \"%s\" bad because of %s", # | ^~ # 2169 | c->argv[1], regerr ); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 38 or more bytes (assuming 293) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 2166| regerror( rc, &mf->mf_regex, regerr, sizeof(regerr) ); # 2167| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 2168|-> "regular expression \"%s\" bad because of %s", # 2169| c->argv[1], regerr ); # 2170| ch_free( mf ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c: scope_hint: In function ‘meta_back_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2174:26: warning[-Wmaybe-uninitialized]: ‘mt’ may be used uninitialized # 2174 | for ( m2 = &mt->mt_filter; *m2; m2 = &(*m2)->mf_next ) # | ~~~^~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1100:26: note: ‘mt’ was declared here # 1100 | metatarget_t *mt; # | ^~ # 2172| } # 2173| ber_str2bv( c->argv[1], 0, 1, &mf->mf_regex_pattern ); # 2174|-> for ( m2 = &mt->mt_filter; *m2; m2 = &(*m2)->mf_next ) # 2175| ; # 2176| *m2 = mf; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2252:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2250| return 1; # 2251| } # 2252|-> mc->mc_network_timeout = (time_t)t; # 2253| } break; # 2254| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2294:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2292| /* save bind creds for referral rebinds? */ # 2293| if ( c->argc == 1 || c->value_int ) { # 2294|-> mc->mc_flags |= LDAP_BACK_F_SAVECRED; # 2295| } else { # 2296| mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2296:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2294| mc->mc_flags |= LDAP_BACK_F_SAVECRED; # 2295| } else { # 2296|-> mc->mc_flags &= ~LDAP_BACK_F_SAVECRED; # 2297| } # 2298| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2302:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2300| case LDAP_BACK_CFG_CHASE: # 2301| if ( c->argc == 1 || c->value_int ) { # 2302|-> mc->mc_flags |= LDAP_BACK_F_CHASE_REFERRALS; # 2303| } else { # 2304| mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2304:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2302| mc->mc_flags |= LDAP_BACK_F_CHASE_REFERRALS; # 2303| } else { # 2304|-> mc->mc_flags &= ~LDAP_BACK_F_CHASE_REFERRALS; # 2305| } # 2306| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2317:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2315| return 1; # 2316| } # 2317|-> mc->mc_flags &= ~LDAP_BACK_F_TLS_MASK; # 2318| mc->mc_flags |= tls_mode[i].mask; # 2319| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2345:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2343| return 1; # 2344| } # 2345|-> mc->mc_flags &= ~LDAP_BACK_F_T_F_MASK2; # 2346| mc->mc_flags |= t_f_mode[i].mask; # 2347| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2440:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2438| return 1; # 2439| } # 2440|-> mc->mc_flags &= ~LDAP_BACK_F_CANCEL_MASK2; # 2441| mc->mc_flags |= cancel_mode[i].mask; # 2442| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2620:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2618| /* session tracking request */ # 2619| if ( c->value_int ) { # 2620|-> mc->mc_flags |= LDAP_BACK_F_ST_REQUEST; # 2621| } else { # 2622| mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2622:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2620| mc->mc_flags |= LDAP_BACK_F_ST_REQUEST; # 2621| } else { # 2622|-> mc->mc_flags &= ~LDAP_BACK_F_ST_REQUEST; # 2623| } # 2624| break; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2635:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘mt’ # 2633| int cnt = 0, argc, ix = c->valx; # 2634| # 2635|-> if ( mt->mt_rwmap.rwm_bva_rewrite ) { # 2636| for ( ; !BER_BVISNULL( &mt->mt_rwmap.rwm_bva_rewrite[ cnt ] ); cnt++ ) # 2637| /* count */ ; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2689:35: warning[-Wmaybe-uninitialized]: ‘i’ may be used uninitialized # 2689 | for ( ; i < cnt; i++ ) { # | ~~^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:1103:13: note: ‘i’ was declared here # 1103 | int i, rc = 0; # | ^ # 2687| } # 2688| if ( ix < cnt ) { # 2689|-> for ( ; i < cnt; i++ ) { # 2690| ca.line = mt->mt_rwmap.rwm_bva_rewrite[ i ].bv_val; # 2691| ca.argc = 0; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2868:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2866| } # 2867| # 2868|-> mc->mc_nretries = nretries; # 2869| } break; # 2870| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2879:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2877| return 1; # 2878| } # 2879|-> mc->mc_version = c->value_int; # 2880| break; # 2881| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2885:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2883| /* do not return search references */ # 2884| if ( c->value_int ) { # 2885|-> mc->mc_flags |= LDAP_BACK_F_NOREFS; # 2886| } else { # 2887| mc->mc_flags &= ~LDAP_BACK_F_NOREFS; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2887:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2885| mc->mc_flags |= LDAP_BACK_F_NOREFS; # 2886| } else { # 2887|-> mc->mc_flags &= ~LDAP_BACK_F_NOREFS; # 2888| } # 2889| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2894:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2892| /* do not propagate undefined search filters */ # 2893| if ( c->value_int ) { # 2894|-> mc->mc_flags |= LDAP_BACK_F_NOUNDEFFILTER; # 2895| } else { # 2896| mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2896:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2894| mc->mc_flags |= LDAP_BACK_F_NOUNDEFFILTER; # 2895| } else { # 2896|-> mc->mc_flags &= ~LDAP_BACK_F_NOUNDEFFILTER; # 2897| } # 2898| break; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2903:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2901| case LDAP_BACK_CFG_CLIENT_PR: # 2902| if ( strcasecmp( c->argv[ 1 ], "accept-unsolicited" ) == 0 ) { # 2903|-> mc->mc_ps = META_CLIENT_PR_ACCEPT_UNSOLICITED; # 2904| # 2905| } else if ( strcasecmp( c->argv[ 1 ], "disable" ) == 0 ) { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2906:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ # 2904| # 2905| } else if ( strcasecmp( c->argv[ 1 ], "disable" ) == 0 ) { # 2906|-> mc->mc_ps = META_CLIENT_PR_DISABLE; # 2907| # 2908| } else if ( lutil_atoi( &mc->mc_ps, c->argv[ 1 ] ) || mc->mc_ps < -1 ) { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:2908:73: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:59: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/config.c:31: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil.h:318:46: note: in definition of macro ‘lutil_atoi’ # 2906| mc->mc_ps = META_CLIENT_PR_DISABLE; # 2907| # 2908|-> } else if ( lutil_atoi( &mc->mc_ps, c->argv[ 1 ] ) || mc->mc_ps < -1 ) { # 2909| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 2910| "unable to parse client-pr {accept-unsolicited|disable|<size>}: \"%s\"", Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c: scope_hint: In function ‘meta_back_init_one_conn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:280:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mc’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:34: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1102:17: note: in expansion of macro ‘LDAP_BACK_PCONN_ROOTDN_SET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:57: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:33: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_queue.h:394:34: note: in definition of macro ‘LDAP_TAILQ_FIRST’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1136:25: note: in expansion of macro ‘LDAP_TAILQ_FOREACH’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1137:52: note: in expansion of macro ‘LDAP_BACK_CONN2PRIV’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:340:46: note: in definition of macro ‘LDAP_BACK_ISSET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/back-meta.h:449:33: note: in expansion of macro ‘mi_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:343:66: note: in expansion of macro ‘li_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:362:41: note: in expansion of macro ‘LDAP_BACK_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1157:38: note: in expansion of macro ‘LDAP_BACK_USE_TEMPORARIES’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:23: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:35: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1527:47: note: in expansion of macro ‘mc_conn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:123:41: note: in expansion of macro ‘LDAP_BACK_CONN_ISSET_F’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-ldap/back-ldap.h:145:49: note: in expansion of macro ‘LDAP_BACK_CONN_ISSET’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1533:37: note: in expansion of macro ‘LDAP_BACK_CONN_ISANON’ # 278| int version; # 279| dncookie dc; # 280|-> int isauthz = ( candidate == mc->mc_authz_target ); # 281| int do_return = 0; # 282| #ifdef HAVE_TLS Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c: scope_hint: In function ‘meta_back_get_candidate’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:918:33: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 918 | int rc; # | ^~ # 916| SlapReply rs2 = { REP_RESULT }; # 917| slap_callback cb2 = { 0 }; # 918|-> int rc; # 919| # 920| /* try to get a unique match for the request ndn Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:940:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 938| cb2.sc_private = (void *)&candidate; # 939| # 940|-> rc = op->o_bd->be_search( &op2, &rs2 ); # 941| # 942| switch ( rs2.sr_err ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1328:5: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 1326| */ # 1327| META_CANDIDATE_RESET( &candidates[ i ] ); # 1328|-> err = candidates[ i ].sr_err; # 1329| continue; # 1330| } Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1367:42: warning[-Wunused-but-set-variable]: variable ‘mt’ set but not used # 1367 | metatarget_t *mt = NULL; # | ^~ # 1365| # 1366| if ( op_type == META_OP_REQUIRE_SINGLE ) { # 1367|-> metatarget_t *mt = NULL; # 1368| metasingleconn_t *msc = NULL; # 1369| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c: scope_hint: In function ‘meta_back_getconn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1368:42: warning[-Wunused-but-set-variable]: variable ‘msc’ set but not used # 1368 | metasingleconn_t *msc = NULL; # | ^~~ # 1366| if ( op_type == META_OP_REQUIRE_SINGLE ) { # 1367| metatarget_t *mt = NULL; # 1368|-> metasingleconn_t *msc = NULL; # 1369| # 1370| int j; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1479:3: warning[deadcode.DeadStores]: Value stored to 'mt' is never read # 1477| ( void )meta_clear_unused_candidates( op, i ); # 1478| # 1479|-> mt = mi->mi_targets[ i ]; # 1480| msc = &mc->mc_conns[ i ]; # 1481| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1480:3: warning[deadcode.DeadStores]: Value stored to 'msc' is never read # 1478| # 1479| mt = mi->mi_targets[ i ]; # 1480|-> msc = &mc->mc_conns[ i ]; # 1481| # 1482| /* Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/conn.c:1581:6: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 1579| } # 1580| /* leave the target candidate, but record the error for later use */ # 1581|-> err = lerr; # 1582| # 1583| if ( lerr == LDAP_UNAVAILABLE && mt->mt_isquarantined != LDAP_BACK_FQ_NO ) { Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/dncache.c:105: error[uninitvar]: Uninitialized variables: tmp_entry.target, tmp_entry.lastupdated # 103| ldap_pvt_thread_mutex_lock( &cache->mutex ); # 104| entry = ( metadncacheentry_t * )ldap_avl_find( cache->tree, # 105|-> ( caddr_t )&tmp_entry, meta_dncache_cmp ); # 106| # 107| if ( entry != NULL ) { Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/dncache.c:161: warning[uninitvar]: Uninitialized variables: tmp_entry.target, tmp_entry.lastupdated # 159| ldap_pvt_thread_mutex_lock( &cache->mutex ); # 160| entry = ( metadncacheentry_t * )ldap_avl_find( cache->tree, # 161|-> ( caddr_t )&tmp_entry, meta_dncache_cmp ); # 162| # 163| if ( entry != NULL ) { Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/dncache.c:212: error[uninitvar]: Uninitialized variables: tmp_entry.target, tmp_entry.lastupdated # 210| # 211| ldap_pvt_thread_mutex_lock( &cache->mutex ); # 212|-> entry = ldap_avl_delete( &cache->tree, ( caddr_t )&tmp_entry, # 213| meta_dncache_cmp ); # 214| ldap_pvt_thread_mutex_unlock( &cache->mutex ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/init.c: scope_hint: In function ‘meta_back_db_open’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/init.c:243:28: warning[-Wunused-variable]: unused variable ‘rc’ # 243 | int i, rc; # | ^~ # 241| char msg[SLAP_TEXT_BUFLEN]; # 242| # 243|-> int i, rc; # 244| # 245| if ( mi->mi_ntargets == 0 ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/map.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/map.c:136: warning[uninitvar]: Uninitialized variable: fmapping.dst # 134| # 135| fmapping.src = *s; # 136|-> *m = (struct ldapmapping *)ldap_avl_find( tree, (caddr_t)&fmapping, mapping_cmp ); # 137| if ( *m == NULL ) { # 138| return map->drop_missing; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c:782:25: warning[-Wunused-but-set-variable]: variable ‘last’ set but not used # 782 | int last = 0, ncandidates = 0, # | ^~~~ # 780| int rc = 0, sres = LDAP_SUCCESS; # 781| char *matched = NULL; # 782|-> int last = 0, ncandidates = 0, # 783| initial_candidates = 0, candidate_match = 0, # 784| needbind = 0; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c: scope_hint: In function ‘meta_back_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c:986:25: warning[-Wunused-but-set-variable]: variable ‘doabandon’ set but not used # 986 | doabandon = 0, # | ^~~~~~~~~ # 984| for ( rc = 0; ncandidates > 0; ) { # 985| int gotit = 0, # 986|-> doabandon = 0, # 987| alreadybound = ncandidates; # 988| Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c:1497:60: warning[-Wformat-truncation=]: ‘ meta_back_search[’ directive output may be truncated writing 18 bytes into a region of size between 1 and 256 # 1497 | "%s meta_back_search[%ld] " # | ^~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c:1497:57: note: directive argument in the range [0, 2147483646] # 1497 | "%s meta_back_search[%ld] " # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/search.c:1497:57: note: directive argument in the range [-2147483648, 2147483647] /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 36 and 310 bytes into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 1495| char buf[ SLAP_TEXT_BUFLEN ]; # 1496| snprintf( buf, sizeof( buf ), # 1497|-> "%s meta_back_search[%ld] " # 1498| "match=\"%s\" err=%ld", # 1499| op->o_log_prefix, i, Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-meta/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_meta 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/backend.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c:86:17: warning[-Wunused-variable]: unused variable ‘ep’ # 86 | Entry **ep = NULL, *prev = NULL; # | ^~ # 84| { # 85| monitor_cache_t tmp_mc, *mc, *pmc = NULL; # 86|-> Entry **ep = NULL, *prev = NULL; # 87| int rc = -1; # 88| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c: scope_hint: In function ‘monitor_cache_add’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c:86:29: warning[-Wunused-variable]: unused variable ‘prev’ # 86 | Entry **ep = NULL, *prev = NULL; # | ^~~~ # 84| { # 85| monitor_cache_t tmp_mc, *mc, *pmc = NULL; # 86|-> Entry **ep = NULL, *prev = NULL; # 87| int rc = -1; # 88| Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c:209: error[uninitvar]: Uninitialized variable: tmp_mc.mc_e # 207| ldap_pvt_thread_mutex_lock( &mi->mi_cache_lock ); # 208| mc = ( monitor_cache_t * )ldap_avl_find( mi->mi_cache, # 209|-> ( caddr_t )&tmp_mc, monitor_cache_cmp ); # 210| # 211| if ( mc != NULL ) { Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c: scope_hint: In function ‘monitor_cache_remove’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c:243:1: warning[-Wunused-label]: label ‘retry’ defined but not used # 243 | retry:; # | ^~~~~ # 241| dnParent( ndn, &pndn ); # 242| # 243|-> retry:; # 244| ldap_pvt_thread_mutex_lock( &mi->mi_cache_lock ); # 245| Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/cache.c:248: error[uninitvar]: Uninitialized variable: tmp_mc.mc_e # 246| tmp_mc.mc_ndn = *ndn; # 247| mc = ( monitor_cache_t * )ldap_avl_find( mi->mi_cache, # 248|-> ( caddr_t )&tmp_mc, monitor_cache_cmp ); # 249| # 250| if ( mc != NULL ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/conn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/conn.c:71:2: warning[deadcode.DeadStores]: Value stored to 'mp' is never read # 69| } # 70| # 71|-> mp = ( monitor_entry_t * )e_conn->e_private; # 72| # 73| /* Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c: scope_hint: In function ‘monitor_subsys_overlay_init_one’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:117:34: warning[-Wunused-but-set-variable]: variable ‘bi’ set but not used # 117 | BackendInfo *bi; # | ^~ # 115| slap_overinst *on2; # 116| slap_overinfo *oi = NULL; # 117|-> BackendInfo *bi; # 118| monitor_entry_t *mp_overlay; # 119| struct berval bv; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:124:2: warning[deadcode.DeadStores]: Value stored to 'bi' is never read # 122| # 123| oi = (slap_overinfo *)be->bd_info->bi_private; # 124|-> bi = oi->oi_orig; # 125| # 126| /* find the overlay number, o */ Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c: scope_hint: In function ‘monitor_subsys_database_init_one’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:370:37: warning[-Wmaybe-uninitialized]: ‘e_overlay’ may be used uninitialized # 370 | *ep = e_overlay; # | ~~~~^~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:363:34: note: ‘e_overlay’ was declared here # 363 | Entry *e_overlay; # | ^~~~~~~~~ # 368| ms, ms_overlay, on, e, &e_overlay ); # 369| if ( overlay == on ) { # 370|-> *ep = e_overlay; # 371| } # 372| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:808:8: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'elpp') # 806| # 807| done_limbo:; # 808|-> if ( *elpp != NULL ) { # 809| el.el_next = NULL; # 810| **elpp = el; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c: scope_hint: In function ‘monitor_back_register_entry_parent’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:808:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘elpp’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:22: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/back-monitor.h:331: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:31: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:2314:14: note: in expansion of macro ‘monitor_entrypriv_create’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:28: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:641:14: note: in expansion of macro ‘BER_BVISNULL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:159:22: note: in expansion of macro ‘ldap_debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:777:25: note: in expansion of macro ‘Debug’ # 806| # 807| done_limbo:; # 808|-> if ( *elpp != NULL ) { # 809| el.el_next = NULL; # 810| **elpp = el; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:1363:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 1361| # 1362| if ( elp->el_type == LIMBO_ENTRY_PARENT # 1363|-> && dn_match( nrdn, &elp->el_e->e_nname ) # 1364| && dn_match( nbase, &elp->el_nbase ) # 1365| && scope == elp->el_scope Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:1363:8: warning[core.NullDereference]: Access to field 'bv_len' results in a dereference of a null pointer (loaded from variable 'nrdn') # 1361| # 1362| if ( elp->el_type == LIMBO_ENTRY_PARENT # 1363|-> && dn_match( nrdn, &elp->el_e->e_nname ) # 1364| && dn_match( nbase, &elp->el_nbase ) # 1365| && scope == elp->el_scope Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c: scope_hint: In function ‘monitor_back_initialize’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/init.c:1642:43: warning[-Wmissing-braces]: missing braces around initializer # 1642 | static ConfigTable monitorcfg[] = { # | ^ # 1640| }; # 1641| # 1642|-> static ConfigTable monitorcfg[] = { # 1643| { NULL, NULL, 0, 0, 0, ARG_IGNORED, # 1644| NULL, NULL, NULL, NULL } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/listener.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/log.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/operation.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/operational.c:67:3: warning[deadcode.DeadStores]: Value stored to 'ap' is never read # 65| *ap = slap_operational_hasSubordinate( hs ); # 66| assert( *ap != NULL ); # 67|-> ap = &(*ap)->a_next; # 68| } # 69| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/overlay.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/rww.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/sent.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/thread.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/time.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_monitor 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-null/null.c:36:32: warning[-Wmissing-braces]: missing braces around initializer # 36 | static ConfigTable nullcfg[] = { # | ^ # 34| } null_info; # 35| # 36|-> static ConfigTable nullcfg[] = { # 37| { "bind", "true|FALSE", 1, 2, 0, ARG_ON_OFF|ARG_OFFSET, # 38| (void *)offsetof(null_info, ni_bind_allowed), Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-null/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-null/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_null 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-passwd/config.c:43:34: warning[-Wmissing-braces]: missing braces around initializer # 43 | static ConfigTable passwdcfg[] = { # | ^ # 41| #include "slap-config.h" # 42| # 43|-> static ConfigTable passwdcfg[] = { # 44| { "file", "filename", 2, 2, 0, # 45| #ifdef HAVE_SETPWFILE Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-passwd/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-passwd/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-passwd/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_passwd 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/add.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/close.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/compare.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c:29:32: warning[-Wmissing-braces]: missing braces around initializer # 29 | static ConfigTable perlcfg[] = { # | ^ # 27| }; # 28| # 29|-> static ConfigTable perlcfg[] = { # 30| { "perlModule", "module", 2, 2, 0, # 31| ARG_STRING|ARG_MAGIC|PERL_MODULE, perl_cf, Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c: scope_hint: At top level openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c:68:18: warning[-Wunused-variable]: ‘ovperlocs’ defined but not used # 68 | static ConfigOCs ovperlocs[] = { # | ^~~~~~~~~ # 66| }; # 67| # 68|-> static ConfigOCs ovperlocs[] = { # 69| { "( OLcfgDbOc:11.2 " # 70| "NAME 'olcovPerlConfig' " Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c: scope_hint: In function ‘perl_cf’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c:116:13: warning[-Wunused-but-set-variable]: variable ‘loc_sv’ set but not used # 116 | SV* loc_sv; # | ^~~~~~ # 114| { # 115| PerlBackend *pb = (PerlBackend *) c->be->be_private; # 116|-> SV* loc_sv; # 117| int count ; # 118| int args; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c: scope_hint: In function ‘perl_cf’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c:184:76: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 4123 bytes into a region of size 256 # 184 | snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: error %s", # | ^~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 9 or more bytes (assuming 4132) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 182| STRLEN len; # 183| # 184|-> snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: error %s", # 185| c->log, SvPV(ERRSV, len )); # 186| Debug( LDAP_DEBUG_ANY, "%s\n", c->cr_msg ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/config.c:211:4: warning[deadcode.DeadStores]: Value stored to 'loc_sv' is never read # 209| case PERL_PATH: # 210| snprintf( eval_str, EVAL_BUF_SIZE, "push @INC, '%s';", c->argv[1] ); # 211|-> loc_sv = eval_pv( eval_str, 0 ); # 212| /* XXX loc_sv return value is ignored. */ # 213| ber_str2bv( c->argv[1], 0, 0, &bv ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/delete.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/modify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/modrdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-perl/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_perl 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/init.c:33:33: warning[-Wmissing-braces]: missing braces around initializer # 33 | static ConfigTable relaycfg[] = { # | ^ # 31| static ConfigDriver relay_back_cf; # 32| # 33|-> static ConfigTable relaycfg[] = { # 34| { "relay", "relay", 2, 2, 0, # 35| ARG_MAGIC|ARG_DN|ARG_QUOTE, Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:149:14: warning[core.NullDereference]: Access to field 'sr_ref' results in a dereference of a null pointer (loaded from variable 'rs') # 147| # 148| /* if we set sr_err to LDAP_REFERRAL, we must provide one */ # 149|-> rs->sr_ref = referral_rewrite( # 150| default_referral, NULL, &op->o_req_dn, # 151| op->o_tag == LDAP_REQ_SEARCH ? Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c: scope_hint: In function ‘relay_back_select_backend’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:149:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rs’ # 147| # 148| /* if we set sr_err to LDAP_REFERRAL, we must provide one */ # 149|-> rs->sr_ref = referral_rewrite( # 150| default_referral, NULL, &op->o_req_dn, # 151| op->o_tag == LDAP_REQ_SEARCH ? Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:164:14: warning[core.NullDereference]: Access to field 'sr_err' results in a dereference of a null pointer (loaded from variable 'rs') # 162| # 163| if ( fail_mode & RB_BDERR ) { # 164|-> rs->sr_err = rc; # 165| if ( fail_mode & RB_SEND ) { # 166| send_ldap_result( op, rs ); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:164:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rs’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:26: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:126:29: note: in expansion of macro ‘BER_BVISNULL’ # 162| # 163| if ( fail_mode & RB_BDERR ) { # 164|-> rs->sr_err = rc; # 165| if ( fail_mode & RB_SEND ) { # 166| send_ldap_result( op, rs ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/op.c:210: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 208| relay_callback rcb; # 209| # 210|-> relay_back_add_cb( &rcb, op ); # 211| RELAY_WRAP_OP( op, bd, which, { # 212| rc = (&bi->bi_op_bind)[which]( op, rs ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-relay/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_relay 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-sock/config.c:46:30: warning[-Wmissing-braces]: missing braces around initializer # 46 | static ConfigTable bscfg[] = { # | ^ # 44| #define NUM_OV_ATTRS 3 # 45| # 46|-> static ConfigTable bscfg[] = { # 47| { "sockops", "ops", 2, 0, 0, ARG_MAGIC|BS_OPS, # 48| bs_cf_gen, "( OLcfgDbAt:7.3 NAME 'olcOvSocketOps' " Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-sock/result.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-sock/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-sock/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: back_sock 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backend.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backend.c:1490:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1488| if ( target && dn_match( &target->e_nname, gr_ndn ) ) { # 1489| e = target; # 1490|-> rc = 0; # 1491| # 1492| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backend.c:1494:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1492| } else { # 1493| op->o_private = NULL; # 1494|-> rc = be_entry_get_rw( op, gr_ndn, group_oc, group_at, 0, &e ); # 1495| e_priv = op->o_private; # 1496| op->o_private = o_priv; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backend.c:2006:3: warning[deadcode.DeadStores]: Value stored to 'ap' is never read # 2004| { # 2005| *ap = slap_operational_subschemaSubentry( op->o_bd ); # 2006|-> ap = &(*ap)->a_next; # 2007| } # 2008| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c: scope_hint: In function ‘glue_back_select’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c:81:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘on’ # 79| } # 80| } # 81|-> be->bd_info = on->on_info->oi_orig; # 82| return be; # 83| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c:291:13: warning[deadcode.DeadStores]: Value stored to 'be' during its initialization is never read # 289| glue_response ( Operation *op, SlapReply *rs ) # 290| { # 291|-> BackendDB *be = op->o_bd; # 292| be = glue_back_select (op->o_bd, &op->o_req_ndn); # 293| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c:461: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 459| case LDAP_SCOPE_SUBTREE: # 460| case LDAP_SCOPE_SUBORDINATE: /* FIXME */ # 461|-> op->o_callback = &cb; # 462| rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM; # 463| scope0 = op->ors_scope; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c: scope_hint: In function ‘glue_open’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c:861:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 859| /* Same bi_open as our main backend? */ # 860| if ( gi->gi_n[i].gn_be->bd_info->bi_open == # 861|-> on->on_info->oi_orig->bi_open ) # 862| bsame = 1; # 863| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c:883:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 881| if ( rc ) break; # 882| } # 883|-> if ( !rc && !bsame && on->on_info->oi_orig->bi_open ) # 884| rc = on->on_info->oi_orig->bi_open( on->on_info->oi_orig ); # 885| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c: scope_hint: In function ‘glue_tool_sync’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backglue.c:1292:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 1290| if (gi->gi_n[i].gn_be->be_sync) # 1291| gi->gi_n[i].gn_be->be_sync (gi->gi_n[i].gn_be); # 1292|-> b0->bd_info = on->on_info->oi_orig; # 1293| if ( b0->be_sync ) # 1294| b0->be_sync( b0 ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:220:8: warning[deadcode.DeadStores]: Value stored to 'next' is never read # 218| on = oi->oi_list; # 219| if ( on ) { # 220|-> for (next = on->on_next; on; on=next) { # 221| next = on->on_next; # 222| free( on ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:239: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 237| # 238| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 239|-> op->o_bd = &db; # 240| for (; on; on=on->on_next ) { # 241| if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED ) Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:295: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 293| db = *op->o_bd; # 294| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 295|-> op->o_bd = &db; # 296| } # 297| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:360: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 358| db = *op->o_bd; # 359| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 360|-> op->o_bd = &db; # 361| } # 362| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:435: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 433| db = *op->o_bd; # 434| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 435|-> op->o_bd = &db; # 436| } # 437| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:517: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 515| db = *op->o_bd; # 516| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 517|-> op->o_bd = &db; # 518| } # 519| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:590: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 588| db = *op->o_bd; # 589| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 590|-> op->o_bd = &db; # 591| } # 592| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:754: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 752| db = *op->o_bd; # 753| db.be_flags |= SLAP_DBFLAG_OVERLAY; # 754|-> op->o_bd = &db; # 755| } # 756| if ( op->o_tag != LDAP_REQ_ABANDON && op->o_tag != LDAP_REQ_UNBIND ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:769:13: warning[core.UndefinedBinaryOperatorResult]: The right operand of '==' is a garbage value # 767| if ( rc != SLAPD_ASYNCOP && op->o_tag != LDAP_REQ_ABANDON && op->o_tag != LDAP_REQ_UNBIND ) { # 768| for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) { # 769|-> if ( *sc == cb ) { # 770| *sc = cb->sc_next; # 771| op->o_tmpfree( cb, op->o_tmpmemctx ); Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c: scope_hint: In function ‘over_op_func’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:769:28: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cb’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:19: included_from: Included from here. # 767| if ( rc != SLAPD_ASYNCOP && op->o_tag != LDAP_REQ_ABANDON && op->o_tag != LDAP_REQ_UNBIND ) { # 768| for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) { # 769|-> if ( *sc == cb ) { # 770| *sc = cb->sc_next; # 771| op->o_tmpfree( cb, op->o_tmpmemctx ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c: scope_hint: In function ‘over_op_func’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:769:28: warning[-Wmaybe-uninitialized]: ‘cb’ may be used uninitialized # 769 | if ( *sc == cb ) { # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:741:24: note: ‘cb’ was declared here # 741 | slap_callback *cb; # | ^~ # 767| if ( rc != SLAPD_ASYNCOP && op->o_tag != LDAP_REQ_ABANDON && op->o_tag != LDAP_REQ_UNBIND ) { # 768| for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) { # 769|-> if ( *sc == cb ) { # 770| *sc = cb->sc_next; # 771| op->o_tmpfree( cb, op->o_tmpmemctx ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:1309:9: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'prev') # 1307| prev = &oi->oi_list; # 1308| for ( i=0; i<idx; i++ ) { # 1309|-> on = *prev; # 1310| prev = &on->on_next; # 1311| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/backover.c:1313:18: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'prev') # 1311| } # 1312| /* insert */ # 1313|-> on2->on_next = *prev; # 1314| *prev = on2; # 1315| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:292:45: warning[-Wmissing-braces]: missing braces around initializer # 292 | static ConfigTable config_back_cf_table[] = { # | ^ # 290| /* alphabetical ordering */ # 291| # 292|-> static ConfigTable config_back_cf_table[] = { # 293| /* This attr is read-only */ # 294| { "", "", 0, 0, 0, ARG_MAGIC, Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:950:34: warning[-Wmissing-braces]: missing braces around initializer # 950 | ConfigTable olcDatabaseDummy[] = { # | ^ # 948| # 949| /* Need to no-op this keyword for dynamic config */ # 950|-> ConfigTable olcDatabaseDummy[] = { # 951| { "", "", 0, 0, 0, ARG_IGNORED, # 952| NULL, "( OLcfgGlAt:13 NAME 'olcDatabase' " Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:1676: warning[uninitvar]: Uninitialized variable: *prev # 1674| prev = &a->acl_next; # 1675| } # 1676|-> a = *prev; # 1677| *prev = a->acl_next; # 1678| acl_free( a ); Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:2252: warning[uninitvar]: Uninitialized variable: sv # 2250| svtail = sv; # 2251| } # 2252|-> sv->al_next = NULL; # 2253| for ( sv = svnew; sv; sv = sv->al_next ) # 2254| sv->al_desc->ad_type->sat_flags |= SLAP_AT_SORTED_VAL; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c: scope_hint: In function ‘config_generic’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:2252:37: warning[-Wmaybe-uninitialized]: ‘svtail’ may be used uninitialized # 2252 | sv->al_next = NULL; # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:2217:48: note: ‘svtail’ was declared here # 2217 | ADlist *svnew = NULL, *svtail, *sv; # | ^~~~~~ # 2250| svtail = sv; # 2251| } # 2252|-> sv->al_next = NULL; # 2253| for ( sv = svnew; sv; sv = sv->al_next ) # 2254| sv->al_desc->ad_type->sat_flags |= SLAP_AT_SORTED_VAL; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6419: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 6417| slap_unpause_server(); # 6418| out: # 6419|-> if ( num_ctrls ) rs->sr_ctrls = ctrls; # 6420| send_ldap_result( op, rs ); # 6421| slap_graduate_commit_csn( op ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6631:29: warning[-Wmaybe-uninitialized]: ‘ixnew’ may be used uninitialized # 6631 | for ( i=0; i<ixnew; i++ ) { # | ~^~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6431:20: note: ‘ixnew’ was declared here # 6431 | int ixold, ixnew, dopause = 1; # | ^~~~~ # 6629| /* Insert into new slot */ # 6630| cprev = cbprev; # 6631|-> for ( i=0; i<ixnew; i++ ) { # 6632| ce2 = *cprev; # 6633| if ( !ce2 ) Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c: scope_hint: In function ‘config_back_modrdn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6648:20: warning[-Wmaybe-uninitialized]: ‘ixold’ may be used uninitialized # 6648 | if ( ixold < ixnew ) { # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6431:13: note: ‘ixold’ was declared here # 6431 | int ixold, ixnew, dopause = 1; # | ^~~~~ # 6646| overlay_move( ce->ce_be, (slap_overinst *)ce->ce_bi, ixnew ); # 6647| # 6648|-> if ( ixold < ixnew ) { # 6649| rs->sr_err = config_rename_del( op, rs, ce, ceold, ixold, # 6650| cfb->cb_use_ldif ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6678: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 6676| slap_unpause_server(); # 6677| out: # 6678|-> if ( num_ctrls ) rs->sr_ctrls = ctrls; # 6679| send_ldap_result( op, rs ); # 6680| return rs->sr_err; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:6855: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 6853| } # 6854| out: # 6855|-> if ( num_ctrls ) rs->sr_ctrls = ctrls; # 6856| #else # 6857| rs->sr_err = LDAP_UNWILLING_TO_PERFORM; Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bconfig.c:7562: warning[uninitvar]: Uninitialized variables: vl.vl_next, vl.vl_ptr # 7560| vl->vl_ptr = on; # 7561| } # 7562|-> for (j=0; vl; j++,vl=v0) { # 7563| on = vl->vl_ptr; # 7564| v0 = vl->vl_next; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bind.c: scope_hint: In function ‘fe_op_lastbind’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/bind.c:506:1: warning[-Wunused-label]: label ‘done’ defined but not used # 506 | done: # | ^~~~ # 504| slap_mods_free( m, 1 ); # 505| # 506|-> done: # 507| return rc; # 508| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/cancel.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ch_malloc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-681): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c: scope_hint: In function ‘config_find_keyword’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c:137:56: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘lutil_b64_pton’ differ in signedness # 137 | c->linelen = lutil_b64_pton( c->line, c->tline, decode_len ); # | ~^~~~~~~ # | | # | char * openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1181: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/lutil.h:55:9: note: expected ‘unsigned char *’ but argument is of type ‘char *’ # 55 | unsigned char *, # | ^~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 135| ch_free( c->tline ); # 136| c->tline = ch_malloc( decode_len+1 ); # 137|-> c->linelen = lutil_b64_pton( c->line, c->tline, decode_len ); # 138| if ( c->linelen < 0 ) # 139| { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c:177:9: warning[deadcode.DeadStores]: Value stored to 'ignored' during its initialization is never read # 175| } # 176| if(Conf->max_args && (c->argc > Conf->max_args)) { # 177|-> char *ignored = " ignored"; # 178| # 179| snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> extra cruft after <%s>", Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c:2048:10: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'next') # 2046| next = line; # 2047| } # 2048|-> while ( *next && strchr( sep, *next ) ) { # 2049| next++; # 2050| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/config.c:2208:32: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 2206| if (inquote) { # 2207| /* these directives parse c->line independently of argv tokenizing */ # 2208|-> for(i = 0; raw[i]; i++) if (!strcasecmp(c->argv[0], raw[i])) return 0; # 2209| # 2210| Debug(LDAP_DEBUG_ANY, "%s: unterminated quoted string \"%s\"\n", c->log, c->argv[c->argc-1] ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/connection.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c: scope_hint: In function ‘register_control_exop’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:385:16: warning[-Wunused-variable]: unused variable ‘extendedops’ # 385 | char **extendedops; # | ^~~~~~~~~~~ # 383| struct slap_control *sc = NULL; # 384| BerVarray extendedopsbv; # 385|-> char **extendedops; # 386| int i; # 387| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:1890:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1888| # 1889| if ( len == 0 ) { # 1890|-> tag = ber_skip_tag( ber, &len ); # 1891| # 1892| } else if ( len > 128 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:1898:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1896| # 1897| } else { # 1898|-> tag = ber_scanf( ber, "m", &sessionSourceIp ); # 1899| } # 1900| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:1913:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1911| # 1912| if ( len == 0 ) { # 1913|-> tag = ber_skip_tag( ber, &len ); # 1914| # 1915| } else if ( len > 65536 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:1921:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1919| # 1920| } else { # 1921|-> tag = ber_scanf( ber, "m", &sessionSourceName ); # 1922| } # 1923| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:1971:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1969| # 1970| if ( len == 0 ) { # 1971|-> tag = ber_skip_tag( ber, &len ); # 1972| # 1973| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/controls.c:1975:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1973| } else { # 1974| /* note: should not be more than 65536... */ # 1975|-> tag = ber_scanf( ber, "m", &sessionTrackingIdentifier ); # 1976| if ( ldif_is_not_printable( sessionTrackingIdentifier.bv_val, sessionTrackingIdentifier.bv_len ) ) { # 1977| /* we want the OID printed, at least */ Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/cr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ctxcsn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: scope_hint: In function ‘slapd_remove’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:458:17: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 458 | int fd, rc, index = SLAP_EPOLL_SOCK_IX(t,(s)); \ # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:1161:9: note: in expansion of macro ‘SLAP_SOCK_DEL’ # 1161 | SLAP_SOCK_DEL(id, s); # | ^~~~~~~~~~~~~ # 456| # 457| # define SLAP_SOCK_DEL(t,s) do { \ # 458|-> int fd, rc, index = SLAP_EPOLL_SOCK_IX(t,(s)); \ # 459| if ( index < 0 ) break; \ # 460| rc = epoll_ctl(slap_daemon[t].sd_epfd, EPOLL_CTL_DEL, \ Error: CPPCHECK_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:1391: warning[nullPointer]: Possible null pointer dereference: host # 1389| sap[1] = NULL; # 1390| # 1391|-> if ( strlen(host) > # 1392| (sizeof(((struct sockaddr_un *)*sap)->sun_path) - 1) ) # 1393| { Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: scope_hint: In function ‘slap_get_listener_addresses’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:1391:22: warning[-Wanalyzer-null-argument]: use of NULL ‘host’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 1389| sap[1] = NULL; # 1390| # 1391|-> if ( strlen(host) > # 1392| (sizeof(((struct sockaddr_un *)*sap)->sun_path) - 1) ) # 1393| { Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2657:45: warning[-Wunused-but-set-variable]: variable ‘nwriters’ set but not used # 2657 | int ns, nwriters; # | ^~~~~~~~ # 2655| while ( !slapd_shutdown ) { # 2656| ber_socket_t i; # 2657|-> int ns, nwriters; # 2658| int at; # 2659| ber_socket_t nfds; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2659:41: warning[-Wunused-but-set-variable]: variable ‘nfds’ set but not used # 2659 | ber_socket_t nfds; # | ^~~~ # 2657| int ns, nwriters; # 2658| int at; # 2659|-> ber_socket_t nfds; # 2660| #if SLAP_EVENTS_ARE_INDEXED # 2661| ber_socket_t nrfds, nwfds; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2740:3: warning[deadcode.DeadStores]: Value stored to 'nwriters' is never read # 2738| ldap_pvt_thread_mutex_lock( &slap_daemon[tid].sd_mutex ); # 2739| # 2740|-> nwriters = slap_daemon[tid].sd_nwriters; # 2741| # 2742| if ( listening ) Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:2760:3: warning[deadcode.DeadStores]: Value stored to 'nfds' is never read # 2758| SLAP_EVENT_INIT(tid); # 2759| # 2760|-> nfds = SLAP_EVENT_MAX(tid); # 2761| # 2762| if (( global_idletimeout ) && slap_daemon[tid].sd_nactives ) at = 1; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: scope_hint: In function ‘slapd_daemon_task’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:3057:48: warning[-Wunused-but-set-variable]: variable ‘r’ set but not used # 3057 | int rc = 1, fd, w = 0, r = 0; # | ^ # 3055| # 3056| for ( i = 0; i < ns; i++ ) { # 3057|-> int rc = 1, fd, w = 0, r = 0; # 3058| # 3059| if ( SLAP_EVENT_IS_LISTENER( tid, i ) ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:3108:6: warning[deadcode.DeadStores]: Value stored to 'r' is never read # 3106| #endif /* HAVE_KQUEUE */ # 3107| { # 3108|-> r = 1; # 3109| Debug( LDAP_DEBUG_CONNS, # 3110| "daemon: read active on %d\n", Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: scope_hint: In function ‘slap_suspend_listeners’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:3558:39: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘**slap_listeners.sl_sd’ # 3556| { # 3557| int i; # 3558|-> for (i=0; slap_listeners[i]; i++) { # 3559| slap_listeners[i]->sl_mute = 1; # 3560| listen( slap_listeners[i]->sl_sd, 0 ); Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:3559:44: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘**slap_listeners.sl_sd’ # 3557| int i; # 3558| for (i=0; slap_listeners[i]; i++) { # 3559|-> slap_listeners[i]->sl_mute = 1; # 3560| listen( slap_listeners[i]->sl_sd, 0 ); # 3561| } Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c: scope_hint: In function ‘slap_resume_listeners’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:3569:39: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘**slap_listeners.sl_sd’ # 3567| { # 3568| int i; # 3569|-> for (i=0; slap_listeners[i]; i++) { # 3570| slap_listeners[i]->sl_mute = 0; # 3571| listen( slap_listeners[i]->sl_sd, SLAPD_LISTEN_BACKLOG ); Error: GCC_ANALYZER_WARNING (CWE-775): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/daemon.c:3570:44: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘**slap_listeners.sl_sd’ # 3568| int i; # 3569| for (i=0; slap_listeners[i]; i++) { # 3570|-> slap_listeners[i]->sl_mute = 0; # 3571| listen( slap_listeners[i]->sl_sd, SLAPD_LISTEN_BACKLOG ); # 3572| } Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/delete.c:202: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 200| op->o_req_dn = pdn; # 201| op->o_req_ndn = pdn; # 202|-> op->o_callback = &cb; # 203| op->o_bd->be_delete( op, rs ); # 204| } else { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/dn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/entry.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/entry.c: scope_hint: In function ‘entry_decode’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/entry.c:818:27: warning[-Wunused-but-set-variable]: variable ‘nvals’ set but not used # 818 | int i, j, nattrs, nvals; # | ^~~~~ # 816| #endif # 817| { # 818|-> int i, j, nattrs, nvals; # 819| int rc; # 820| Attribute *a; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/entry.c:828:2: warning[deadcode.DeadStores]: Value stored to 'nvals' is never read # 826| # 827| nattrs = eh->nattrs; # 828|-> nvals = eh->nvals; # 829| x = entry_alloc(); # 830| x->e_attrs = attrs_alloc( nattrs ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/extended.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/extended.c: scope_hint: In function ‘fe_extended’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/extended.c:203:33: warning[-Wunused-but-set-variable]: variable ‘reqdata’ set but not used # 203 | struct berval reqdata = BER_BVNULL; # | ^~~~~~~ # 201| { # 202| struct extop_list *ext = NULL; # 203|-> struct berval reqdata = BER_BVNULL; # 204| # 205| if (op->ore_reqdata) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/extended.c:206:3: warning[deadcode.DeadStores]: Value stored to 'reqdata' is never read # 204| # 205| if (op->ore_reqdata) { # 206|-> reqdata = *op->ore_reqdata; # 207| } # 208| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/filterentry.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ldapsync.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ldapsync.c:138:22: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'csnp') # 136| { # 137| char *p, *q; # 138|-> struct berval csn = *csnp; # 139| int i; # 140| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/ldapsync.c:313:10: warning[deadcode.DeadStores]: Value stored to 'sid_ptr' during its initialization is never read # 311| } # 312| if ( !strncmp( next, "sid=", STRLENOF("sid=") )) { # 313|-> char *sid_ptr = next; # 314| sid_ptr = next; # 315| cookie->sid = strtol( &sid_ptr[ STRLENOF( "sid=" ) ], &next, 16 ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/limits.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/logging.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/logging.c: scope_hint: In function ‘logfile_open’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/logging.c:228:17: warning[-Wanalyzer-overlapping-buffers]: overlapping buffers passed as arguments to ‘strcpy’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/logging.c:22: included_from: Included from here. /usr/include/string.h:141:14: note: the behavior of ‘strcpy’ is undefined for overlapping buffers # 226| goto fail; # 227| } # 228|-> strcpy( logfile_path, path ); # 229| strcpy( logpaths[0], path ); # 230| strcpy( logpaths[1], path ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/logging.c:365:8: warning[core.NullDereference]: Array access (from variable 'arg') results in a null pointer dereference # 363| int rc; # 364| # 365|-> if ( arg[0] == '-' ) { # 366| rc = lutil_atoix( &level, arg, 0 ); # 367| } else { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/main.c:246:8: warning[deadcode.DeadStores]: Value stored to 'serverNamePrefix' during its initialization is never read # 244| struct sync_cookie *scp_entry = NULL; # 245| # 246|-> char *serverNamePrefix = ""; # 247| size_t l; # 248| Error: COMPILER_WARNING (CWE-252): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/main.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/main.c:858:17: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ # 858 | write( waitfds[1], "1", 1 ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 856| #ifndef HAVE_WINSOCK # 857| if ( !no_detach ) { # 858|-> write( waitfds[1], "1", 1 ); # 859| close( waitfds[1] ); # 860| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/matchedValues.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modify.c:657:6: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value # 655| if ( rc == LDAP_TYPE_OR_VALUE_EXISTS ) { # 656| /* value exists already */ # 657|-> snprintf( textbuf, textlen, # 658| "%s: value #%d provided more than once", # 659| ml->sml_desc->ad_cname.bv_val, i ); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modify.c: scope_hint: In function ‘slap_mods_opattrs’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modify.c:874:41: warning[-Wunused-but-set-variable]: variable ‘modlast’ set but not used # 874 | Modifications *mod, **modtail, *modlast; # | ^~~~~~~ # 872| char timebuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; # 873| char csnbuf[ LDAP_PVT_CSNSTR_BUFSIZE ]; # 874|-> Modifications *mod, **modtail, *modlast; # 875| int gotcsn = 0, gotmname = 0, gotmtime = 0; # 876| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modify.c:958:4: warning[deadcode.DeadStores]: Value stored to 'modlast' is never read # 956| mod->sml_nvalues = NULL; # 957| *modtail = mod; # 958|-> modlast = mod; # 959| modtail = &mod->sml_next; # 960| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modify.c:997:4: warning[deadcode.DeadStores]: Value stored to 'modtail' is never read # 995| mod->sml_nvalues = NULL; # 996| *modtail = mod; # 997|-> modtail = &mod->sml_next; # 998| } # 999| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:354: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 352| op->o_req_dn = pdn; # 353| op->o_req_ndn = pdn; # 354|-> op->o_callback = &cb; # 355| op->o_bd->be_delete( op, rs ); # 356| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:513:20: warning[core.NullDereference]: Array access (from variable 'old_rdn') results in a null pointer dereference # 511| /* Remove old rdn value if required */ # 512| if ( op->orr_deleteoldrdn ) { # 513|-> for ( d_cnt = 0; old_rdn[d_cnt]; d_cnt++ ) { # 514| AttributeDescription *desc = NULL; # 515| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c: scope_hint: In function ‘slap_modrdn2mods’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:513:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:34: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:41: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:452:14: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/modrdn.c:512:18: note: in expansion of macro ‘orr_deleteoldrdn’ # 511| /* Remove old rdn value if required */ # 512| if ( op->orr_deleteoldrdn ) { # 513|-> for ( d_cnt = 0; old_rdn[d_cnt]; d_cnt++ ) { # 514| AttributeDescription *desc = NULL; # 515| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/mods.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/mods.c:55:3: warning[deadcode.DeadStores]: Value stored to 'op' is never read # 53| break; # 54| default: # 55|-> op = "?"; # 56| assert( 0 ); # 57| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/module.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/mr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/mra.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/mra.c:152:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 150| if( rc != LDAP_SUCCESS ) { # 151| ma.ma_desc = slap_bv2tmp_ad( &type, op->o_tmpmemctx ); # 152|-> rc = LDAP_SUCCESS; # 153| } # 154| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/oc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/oidm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:112:34: warning[-Wmissing-braces]: missing braces around initializer # 112 | static ConfigTable log_cfats[] = { # | ^ # 110| }; # 111| # 112|-> static ConfigTable log_cfats[] = { # 113| { "logdb", "suffix", 2, 2, 0, ARG_DN|ARG_QUOTE|ARG_MAGIC|LOG_DB, # 114| log_cf_gen, "( OLcfgOvAt:4.1 NAME 'olcAccessLogDB' " Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:617:3: warning[deadcode.DeadStores]: Value stored to 'size' is never read # 615| len = snprintf( ptr, size, ":%02d", ss ); # 616| assert( len >= 0 && (unsigned) len < size ); # 617|-> size -= len; # 618| ptr += len; # 619| } Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c: scope_hint: In function ‘accesslog_purge’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:705:14: warning[-Wunused-variable]: unused variable ‘csnbuf’ # 705 | char csnbuf[LDAP_PVT_CSNSTR_BUFSIZE]; # | ^~~~~~ # 703| purge_data pd = { .li = li }; # 704| char timebuf[LDAP_LUTIL_GENTIME_BUFSIZE]; # 705|-> char csnbuf[LDAP_PVT_CSNSTR_BUFSIZE]; # 706| time_t old = slap_get_time(); # 707| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:1324:3: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 1322| ptr = noid.bv_val = ber_memalloc_x( noid.bv_len + 1, memctx ); # 1323| ptr = lutil_strcopy( ptr, idx.bv_val ); # 1324|-> ptr = lutil_strcopy( ptr, oid.bv_val ); # 1325| # 1326| bv.bv_len = idx.bv_len + STRLENOF( "{}" ) + oid.bv_len; Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c: scope_hint: In function ‘accesslog_response’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2027:1: warning[-Wunused-label]: label ‘done’ defined but not used # 2027 | done: # | ^~~~ # 2025| } # 2026| # 2027|-> done: # 2028| ldap_pvt_thread_mutex_unlock( &li->li_log_mutex ); # 2029| if ( old ) entry_free( old ); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c: scope_hint: In function ‘accesslog_op_mod’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2114:21: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 2114 | int rc; # | ^~ # 2112| ( op->o_tag == LDAP_REQ_MODRDN && li->li_oldattrs ))) # 2113| { # 2114|-> int rc; # 2115| Entry *e; # 2116| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2118:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2116| # 2117| op->o_bd->bd_info = (BackendInfo *)on->on_info; # 2118|-> rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &e ); # 2119| if ( e ) { # 2120| if ( test_filter( op, e, li->li_oldf ) == LDAP_COMPARE_TRUE ) Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2127:21: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 2127 | int rc; # | ^~ # 2125| # 2126| } else { # 2127|-> int rc; # 2128| Entry *e; # 2129| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2131:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2129| # 2130| op->o_bd->bd_info = (BackendInfo *)on->on_info; # 2131|-> rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &e ); # 2132| if ( e ) { # 2133| Attribute *a = attr_find( e->e_attrs, slap_schema.si_ad_entryUUID ); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c: scope_hint: In function ‘accesslog_db_root’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2399:13: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 2399 | int rc; # | ^~ # 2397| # 2398| Entry *e; # 2399|-> int rc; # 2400| # 2401| ldap_pvt_thread_mutex_lock( &li->li_log_mutex ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2407:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2405| op->o_dn = li->li_db->be_rootdn; # 2406| op->o_ndn = li->li_db->be_rootndn; # 2407|-> rc = be_entry_get_rw( op, li->li_db->be_nsuffix, NULL, NULL, 0, &e ); # 2408| # 2409| if ( e ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2441:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2439| op->orm_modlist = &mod; # 2440| op->orm_no_opattrs = 1; # 2441|-> rc = op->o_bd->be_modify( op, &rs ); # 2442| } # 2443| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2487:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2485| /* Get contextCSN from main DB */ # 2486| op->o_bd = on->on_info->oi_origdb; # 2487|-> rc = be_entry_get_rw( op, op->o_bd->be_nsuffix, NULL, # 2488| slap_schema.si_ad_contextCSN, 0, &e_ctx ); # 2489| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2513:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2511| op->o_callback = &nullsc; # 2512| SLAP_DBFLAGS( op->o_bd ) |= SLAP_DBFLAG_NOLASTMOD; # 2513|-> rc = op->o_bd->be_add( op, &rs ); # 2514| if ( rs.sr_err != LDAP_SUCCESS ) { # 2515| Debug( LDAP_DEBUG_SYNC, "%s accesslog_db_root: " Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2625:26: warning[-Wunused-variable]: unused variable ‘c2’ # 2625 | int part, c, c1, c2, tzoffset, leapyear = 0; # | ^~ # 2623| }; # 2624| char *p, *e; # 2625|-> int part, c, c1, c2, tzoffset, leapyear = 0; # 2626| # 2627| p = val->bv_val; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c: scope_hint: In function ‘check_rdntime_syntax’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/accesslog.c:2676:31: warning[-Wunused-variable]: unused variable ‘end_num’ # 2676 | char *end_num; # | ^~~~~~~ # 2674| fraction->bv_len = 0; # 2675| if (p < e && (*p == '.' || *p == ',')) { # 2676|-> char *end_num; # 2677| while (++p < e && ASCII_DIGIT(*p)) { # 2678| /* EMPTY */; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/auditlog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/auditlog.c:40:36: warning[-Wmissing-braces]: missing braces around initializer # 40 | static ConfigTable auditlogcfg[] = { # | ^ # 38| } auditlog_data; # 39| # 40|-> static ConfigTable auditlogcfg[] = { # 41| { "auditlog", "filename", 2, 2, 0, # 42| ARG_STRING|ARG_OFFSET, Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:47:9: warning: "X509_get_notBefore" redefined # 47 | #define X509_get_notBefore(x) X509_getm_notBefore(x) # | ^~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:35: included_from: Included from here. /usr/include/openssl/x509.h:859:11: note: this is the location of the previous definition # 859 | # define X509_get_notBefore X509_getm_notBefore # | ^~~~~~~~~~~~~~~~~~ # 45| #if OPENSSL_VERSION_NUMBER >= 0x10100000 # 46| #include <openssl/rsa.h> # 47|-> #define X509_get_notBefore(x) X509_getm_notBefore(x) # 48| #define X509_get_notAfter(x) X509_getm_notAfter(x) # 49| #endif Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:48:9: warning: "X509_get_notAfter" redefined # 48 | #define X509_get_notAfter(x) X509_getm_notAfter(x) # | ^~~~~~~~~~~~~~~~~ /usr/include/openssl/x509.h:860:11: note: this is the location of the previous definition # 860 | # define X509_get_notAfter X509_getm_notAfter # | ^~~~~~~~~~~~~~~~~ # 46| #include <openssl/rsa.h> # 47| #define X509_get_notBefore(x) X509_getm_notBefore(x) # 48|-> #define X509_get_notAfter(x) X509_getm_notAfter(x) # 49| #endif # 50| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:452: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 450| op->o_bd->bd_info = args->on->on_info->oi_orig; # 451| op->o_tag = LDAP_REQ_MODIFY; # 452|-> op->o_callback = &cb; # 453| op->orm_modlist = mod; # 454| op->orm_no_opattrs = 1; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:561: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 559| # 560| op->o_tag = LDAP_REQ_MODIFY; # 561|-> op->o_callback = &cb; # 562| op->orm_modlist = mod; # 563| op->orm_no_opattrs = 1; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:728:35: warning[-Wmissing-braces]: missing braces around initializer # 728 | static ConfigTable autoca_cfg[] = { # | ^ # 726| } # 727| # 728|-> static ConfigTable autoca_cfg[] = { # 729| { "userClass", "objectclass", 2, 2, 0, # 730| ARG_STRING|ARG_MAGIC|ACA_USRCLASS, autoca_cf, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/autoca.c:1011:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1009| op->o_dn = be->be_rootdn; # 1010| op->o_ndn = be->be_rootndn; # 1011|-> rc = overlay_entry_get_ov( op, be->be_nsuffix, NULL, # 1012| NULL, 0, &e, on ); # 1013| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/collect.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/collect.c:54:35: warning[-Wmissing-braces]: missing braces around initializer # 54 | static ConfigTable collectcfg[] = { # | ^ # 52| static int collect_cf( ConfigArgs *c ); # 53| # 54|-> static ConfigTable collectcfg[] = { # 55| { "collectinfo", "dn> <attribute", 3, 3, 0, # 56| ARG_MAGIC, collect_cf, Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/collect.c:344: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 342| "cannot change virtual attribute '%s'", # 343| ci->ci_ad[idx]->ad_cname.bv_val); # 344|-> rs->sr_text = errMsg; # 345| send_ldap_result( op, rs ); # 346| return rs->sr_err; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/collect.c: scope_hint: In function ‘collect_response’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/collect.c:366:21: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 366 | int rc; # | ^~ # 364| */ # 365| if ( ci && rs->sr_type == REP_SEARCH ) { # 366|-> int rc; # 367| # 368| op->o_bd->bd_info = (BackendInfo *)on->on_info; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/collect.c:397:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 395| /* Extract the values of the desired attribute from # 396| * the ancestor entry */ # 397|-> rc = backend_attribute( op, NULL, &ci->ci_dn, # 398| ci->ci_ad[idx], &vals, ACL_READ ); # 399| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:90:38: warning[-Wmissing-braces]: missing braces around initializer # 90 | static ConfigTable constraintcfg[] = { # | ^ # 88| static ConfigDriver constraint_cf_gen; # 89| # 90|-> static ConfigTable constraintcfg[] = { # 91| { "constraint_attribute", "attribute[list]> (regex|negregex|uri|set|size|count) <value> [<restrict URI>]", # 92| 4, 0, 0, ARG_MAGIC | CONSTRAINT_ATTRIBUTE, constraint_cf_gen, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:216:28: warning[core.NullDereference]: Dereference of null pointer # 214| s = bv.bv_val = ch_malloc(bv.bv_len + 1); # 215| # 216|-> s = lutil_strncopy( s, cp->ap[0]->ad_cname.bv_val, cp->ap[0]->ad_cname.bv_len ); # 217| for (j = 1; cp->ap[j]; j++) { # 218| *s++ = ','; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c: scope_hint: In function ‘constraint_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:319:98: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 216 # 319 | "%s %s: Illegal regular expression \"%s\": Error %s", # | ^~ # 320 | c->argv[0], c->argv[1], c->argv[3], errmsg); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 41 or more bytes (assuming 1064) into a destination of size 256 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 317| ch_free(ap.re); # 318| snprintf( c->cr_msg, sizeof( c->cr_msg ), # 319|-> "%s %s: Illegal regular expression \"%s\": Error %s", # 320| c->argv[0], c->argv[1], c->argv[3], errmsg); # 321| ap.re = NULL; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c: scope_hint: In function ‘constraint_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:327:40: warning[-Wunused-variable]: unused variable ‘size’ # 327 | size_t size; # | ^~~~ # 325| ber_str2bv( c->argv[3], 0, 1, &ap.val ); # 326| } else if ( strcasecmp( c->argv[2], SIZE_STR ) == 0 ) { # 327|-> size_t size; # 328| char *endptr; # 329| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:335:40: warning[-Wunused-variable]: unused variable ‘count’ # 335 | size_t count; # | ^~~~~ # 333| rc = ARG_BAD_CONF; # 334| } else if ( strcasecmp( c->argv[2], COUNT_STR ) == 0 ) { # 335|-> size_t count; # 336| char *endptr; # 337| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c: scope_hint: In function ‘constraint_check_count_violation’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:891:19: warning[-Wunused-variable]: unused variable ‘b’ # 891 | BerVarray b = NULL; # | ^ # 889| constraint_check_count_violation( Modifications *m, Entry *target_entry, constraint *cp ) # 890| { # 891|-> BerVarray b = NULL; # 892| unsigned ce = 0; # 893| unsigned ca; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:988:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 986| # 987| op->o_bd = on->on_info->oi_origdb; # 988|-> rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &target_entry ); # 989| op->o_bd = be; # 990| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:1014:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1012| } # 1013| # 1014|-> rc = LDAP_CONSTRAINT_VIOLATION; # 1015| for(;m; m = m->sml_next) { # 1016| unsigned ce = 0; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c: scope_hint: In function ‘constraint_update’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/constraint.c:1016:26: warning[-Wunused-variable]: unused variable ‘ce’ # 1016 | unsigned ce = 0; # | ^~ # 1014| rc = LDAP_CONSTRAINT_VIOLATION; # 1015| for(;m; m = m->sml_next) { # 1016|-> unsigned ce = 0; # 1017| # 1018| if (is_at_operational( m->sml_desc->ad_type )) continue; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dds.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dds.c:1240:32: warning[-Wmissing-braces]: missing braces around initializer # 1240 | static ConfigTable dds_cfg[] = { # | ^ # 1238| #endif # 1239| # 1240|-> static ConfigTable dds_cfg[] = { # 1241| { "dds-state", "on|off", # 1242| 2, 2, 0, ARG_MAGIC|ARG_ON_OFF|DDS_STATE, dds_cfgen, Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:419:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 417| ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx ); # 418| # 419|-> rc = ber_printf( ber, "{" /*}*/ ); # 420| for ( dr = drhead; dr != NULL; dr = dr->dr_next ) { # 421| for ( i = 0; !BER_BVISNULL( &dr->dr_vals[ i ].dv_derefSpecVal ); i++ ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:428:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 426| } # 427| # 428|-> rc = ber_printf( ber, "{OO" /*}*/, # 429| &dr->dr_spec.ds_derefAttr->ad_cname, # 430| &dr->dr_vals[ i ].dv_derefSpecVal ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:435:8: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 433| if ( dr->dr_vals[ i ].dv_attrVals[ j ] != NULL ) { # 434| if ( first ) { # 435|-> rc = ber_printf( ber, "t{" /*}*/, # 436| (LBER_CONSTRUCTED|LBER_CLASS_CONTEXT) ); # 437| first = 0; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:439:7: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 437| first = 0; # 438| } # 439|-> rc = ber_printf( ber, "{O[W]}", # 440| &dr->dr_spec.ds_attributes[ j ]->ad_cname, # 441| dr->dr_vals[ i ].dv_attrVals[ j ] ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:447:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 445| } # 446| if ( !first ) { # 447|-> rc = ber_printf( ber, /*{{*/ "}N}" ); # 448| } else { # 449| rc = ber_printf( ber, /*{*/ "}" ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:449:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 447| rc = ber_printf( ber, /*{{*/ "}N}" ); # 448| } else { # 449|-> rc = ber_printf( ber, /*{*/ "}" ); # 450| } # 451| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/deref.c:453:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 451| } # 452| } # 453|-> rc = ber_printf( ber, /*{*/ "}" ); # 454| if ( ber_flatten2( ber, &ctrlval, 0 ) == -1 ) { # 455| if ( op->o_deref == SLAP_CONTROL_CRITICAL ) { Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c:85: warning[uninitvar]: Uninitialized variable: ap # 83| ap = *app; # 84| } # 85|-> *app = ap->ap_next; # 86| ch_free( ap ); # 87| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c:85:11: warning[core.NullDereference]: Access to field 'ap_next' results in a dereference of an undefined pointer value (loaded from variable 'ap') # 83| ap = *app; # 84| } # 85|-> *app = ap->ap_next; # 86| ch_free( ap ); # 87| } Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c: scope_hint: In function ‘dgroup_cf’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c:85:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ap’ # 83| ap = *app; # 84| } # 85|-> *app = ap->ap_next; # 86| ch_free( ap ); # 87| } Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c: scope_hint: In function ‘dgroup_cf’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c:85:34: warning[-Wmaybe-uninitialized]: ‘ap’ may be used uninitialized # 85 | *app = ap->ap_next; # | ~~^~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c:79:40: note: ‘ap’ was declared here # 79 | adpair **app, *ap; # | ^~ # 83| ap = *app; # 84| } # 85|-> *app = ap->ap_next; # 86| ch_free( ap ); # 87| } Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dyngroup.c:127:34: warning[-Wmissing-braces]: missing braces around initializer # 127 | static ConfigTable dgroupcfg[] = { # | ^ # 125| } # 126| # 127|-> static ConfigTable dgroupcfg[] = { # 128| { "attrpair", "member-attribute> <URL-attribute", 3, 3, 0, # 129| ARG_MAGIC, dgroup_cf, Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c: scope_hint: In function ‘dynlist_filter_dup’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:1421:17: warning[-Wmaybe-uninitialized]: ‘n’ may be used uninitialized # 1421 | Filter *n; # | ^ # 1419| dynlist_filter_dup( Operation *op, Filter *f, AttributeDescription *ad, dynlist_search_t *ds ) # 1420| { # 1421|-> Filter *n; # 1422| # 1423| if ( !f ) Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c: scope_hint: In function ‘dynlist_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:1954:60: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘opattrs’ # 1952| want |= WANT_MEMBER; # 1953| } else { # 1954|-> if ( opattrs ) { # 1955| if ( dlm->dlm_memberOf_oper ) { # 1956| want |= WANT_MEMBEROF; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c: scope_hint: In function ‘dynlist_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:1954:60: warning[-Wmaybe-uninitialized]: ‘opattrs’ may be used uninitialized # 1954 | if ( opattrs ) { # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:1879:13: note: ‘opattrs’ was declared here # 1879 | int opattrs, userattrs; # | ^~~~~~~ # 1952| want |= WANT_MEMBER; # 1953| } else { # 1954|-> if ( opattrs ) { # 1955| if ( dlm->dlm_memberOf_oper ) { # 1956| want |= WANT_MEMBEROF; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:1961:60: warning[-Wmaybe-uninitialized]: ‘userattrs’ may be used uninitialized # 1961 | if ( userattrs ) { # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:1879:22: note: ‘userattrs’ was declared here # 1879 | int opattrs, userattrs; # | ^~~~~~~~~ # 1959| } # 1960| } # 1961|-> if ( userattrs ) { # 1962| if ( !dlm->dlm_memberOf_oper ) { # 1963| want |= WANT_MEMBEROF; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/dynlist.c:2136:30: warning[-Wmissing-braces]: missing braces around initializer # 2136 | static ConfigTable dlcfg[] = { # | ^ # 2134| # 2135| /* XXXmanu 255 is the maximum arguments we allow. Can we go beyond? */ # 2136|-> static ConfigTable dlcfg[] = { # 2137| { "dynlist-attrset", "group-oc> [uri] <URL-ad> <[mapped:]member-ad> [...]", # 2138| 3, 0, 0, ARG_MAGIC|DL_ATTRSET, dl_cfgen, Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:152:35: warning[-Wmissing-braces]: missing braces around initializer # 152 | static ConfigTable homedircfg[] = { # | ^ # 150| static slap_overinst homedir; # 151| # 152|-> static ConfigTable homedircfg[] = { # 153| { "homedir-skeleton-path", "pathname", 2, 2, 0, # 154| ARG_STRING|ARG_OFFSET, Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c: scope_hint: In function ‘traverse_tar_pre’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1292:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 100 equals destination size # 1292 | strncpy( tar->name, ch + 1, 100 ); # | ^ # 1290| ch = name + name_len - 100; # 1291| } # 1292|-> strncpy( tar->name, ch + 1, 100 ); # 1293| { # 1294| int prefix_len = ( ch - 1 ) - name; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1301:33: warning[-Wformat-truncation=]: ‘%06lo’ directive output may be truncated writing between 6 and 11 bytes into a region of size 8 # 1301 | snprintf( tar->uid, 8, "%06lo ", (long)st->st_uid ); # | ^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1301:32: note: directive argument in the range [0, 4294967295] # 1301 | snprintf( tar->uid, 8, "%06lo ", (long)st->st_uid ); # | ^~~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 8 and 13 bytes into a destination of size 8 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 1299| # 1300| snprintf( tar->mode, 8, "%06lo ", (long)st->st_mode & 07777 ); # 1301|-> snprintf( tar->uid, 8, "%06lo ", (long)st->st_uid ); # 1302| snprintf( tar->gid, 8, "%06lo ", (long)st->st_gid ); # 1303| snprintf( tar->mtime, 12, "%010lo ", (long)st->st_mtime ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c: scope_hint: In function ‘traverse_tar_pre’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1302:33: warning[-Wformat-truncation=]: ‘%06lo’ directive output may be truncated writing between 6 and 11 bytes into a region of size 8 # 1302 | snprintf( tar->gid, 8, "%06lo ", (long)st->st_gid ); # | ^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1302:32: note: directive argument in the range [0, 4294967295] # 1302 | snprintf( tar->gid, 8, "%06lo ", (long)st->st_gid ); # | ^~~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 8 and 13 bytes into a destination of size 8 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 1300| snprintf( tar->mode, 8, "%06lo ", (long)st->st_mode & 07777 ); # 1301| snprintf( tar->uid, 8, "%06lo ", (long)st->st_uid ); # 1302|-> snprintf( tar->gid, 8, "%06lo ", (long)st->st_gid ); # 1303| snprintf( tar->mtime, 12, "%010lo ", (long)st->st_mtime ); # 1304| snprintf( tar->size, 12, "%010lo ", (long)0 ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1553:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1551| /* fall-through */ # 1552| case DEL_DELETE: # 1553|-> rc = delete_tree( path, ctx ); # 1554| break; # 1555| default: Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1855: error[legacyUninitvar]: Uninitialized variable: new_presence # 1853| # 1854| } else if ( old_valid && !new_valid && # 1855|-> !new_presence ) { /* like a del */ # 1856| Debug( LDAP_DEBUG_TRACE, "homedir: " # 1857| "homedir_mod_response: treating like a del\n" ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1855:6: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 1853| # 1854| } else if ( old_valid && !new_valid && # 1855|-> !new_presence ) { /* like a del */ # 1856| Debug( LDAP_DEBUG_TRACE, "homedir: " # 1857| "homedir_mod_response: treating like a del\n" ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1880:32: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 1878| "homedir_mod_response: nothing to do\n" ); # 1879| } # 1880|-> } else if ( old_presence || new_presence ) { # 1881| Debug( LDAP_DEBUG_ANY, "homedir: " # 1882| "homedir_mod_response: <%s> values present " Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c: scope_hint: In function ‘homedir_mod_response’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1880:50: warning[-Wmaybe-uninitialized]: ‘new_presence’ may be used uninitialized # 1880 | } else if ( old_presence || new_presence ) { # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/homedir.c:1810:43: note: ‘new_presence’ declared here # 1810 | int old_presence, new_presence; # | ^~~~~~~~~~~~ # 1878| "homedir_mod_response: nothing to do\n" ); # 1879| } # 1880|-> } else if ( old_presence || new_presence ) { # 1881| Debug( LDAP_DEBUG_ANY, "homedir: " # 1882| "homedir_mod_response: <%s> values present " Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:655:32: warning[core.NullDereference]: Access to field 'a_nvals' results in a dereference of a null pointer (loaded from variable 'a') # 653| AccessControlState acl_state = ACL_STATE_INIT; # 654| # 655|-> for ( i = 0; !BER_BVISNULL( &a->a_nvals[ i ] ); i++ ) { # 656| Entry *e; # 657| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:991:7: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 989| &acl_state ); # 990| if ( rc == 0 ) { # 991|-> rc = rs->sr_err = LDAP_INSUFFICIENT_ACCESS; # 992| rs->sr_text = NULL; # 993| send_ldap_result( op, rs ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1006:8: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1004| # 1005| if ( MEMBEROF_DANGLING_ERROR( mo ) ) { # 1006|-> rc = rs->sr_err = mo->mo_dangling_err; # 1007| rs->sr_text = "deleting non-existing object " # 1008| "as memberof"; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1081:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1079| op->o_bd->bd_info = (BackendInfo *)on; # 1080| if ( rc == 0 ) { # 1081|-> rc = rs->sr_err = LDAP_INSUFFICIENT_ACCESS; # 1082| rs->sr_text = NULL; # 1083| send_ldap_result( op, rs ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1109:6: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1107| &acl_state ); # 1108| if ( rc == 0 ) { # 1109|-> rc = rs->sr_err = LDAP_INSUFFICIENT_ACCESS; # 1110| rs->sr_text = NULL; # 1111| send_ldap_result( op, rs ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1124:7: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1122| if ( rc != LDAP_SUCCESS ) { # 1123| if ( MEMBEROF_DANGLING_ERROR( mo ) ) { # 1124|-> rc = rs->sr_err = mo->mo_dangling_err; # 1125| rs->sr_text = "adding non-existing object " # 1126| "as memberof"; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1212:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 1210| op->o_ndn = op->o_bd->be_rootndn; # 1211| op->o_bd->bd_info = (BackendInfo *)on->on_info; # 1212|-> rc = backend_attribute( op, NULL, &op->o_req_ndn, # 1213| mo->mo_ad_member, &mci->member, ACL_READ ); # 1214| op->o_bd->bd_info = (BackendInfo *)on; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1665:31: warning[-Wmissing-braces]: missing braces around initializer # 1665 | static ConfigTable mo_cfg[] = { # | ^ # 1663| # 1664| # 1665|-> static ConfigTable mo_cfg[] = { # 1666| { "memberof-dn", "modifiersName", # 1667| 2, 2, 0, ARG_MAGIC|ARG_QUOTE|ARG_DN|MO_DN, mo_cf_gen, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:1811:2: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 1809| *ptr++ = '('; # 1810| ptr = lutil_strcopy( ptr, mo->mo_ad_memberof->ad_cname.bv_val ); # 1811|-> ptr = lutil_strcopy( ptr, "=*)" ); # 1812| # 1813| return 0; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c: scope_hint: In function ‘memberof_db_open’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/memberof.c:2066:25: warning[-Wunused-variable]: unused variable ‘rc’ # 2066 | int rc; # | ^~ # 2064| memberof_t *mo = (memberof_t *)on->on_bi.bi_private; # 2065| # 2066|-> int rc; # 2067| # 2068| if ( !mo->mo_ad_memberof ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/otp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:761:12: warning[-Wmaybe-uninitialized]: ‘expiry_time’ may be used uninitialized # 761 | if ( expiry_time <= slap_get_time()) { # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c: scope_hint: In function ‘pcache_db_open2’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:610:25: note: ‘expiry_time’ was declared here # 610 | time_t expiry_time; # | ^~~~~~~~~~~ # 759| # 760| /* ignore expired queries */ # 761|-> if ( expiry_time <= slap_get_time()) { # 762| Operation op2 = *op; # 763| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:864: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 862| op->o_tag = LDAP_REQ_ADD; # 863| op->o_protocol = LDAP_VERSION3; # 864|-> op->o_callback = &cb; # 865| op->o_time = slap_get_time(); # 866| op->o_do_not_cache = 1; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:1814: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1812| op->o_tag = LDAP_REQ_SEARCH; # 1813| op->o_protocol = LDAP_VERSION3; # 1814|-> op->o_callback = &cb; # 1815| op->o_time = slap_get_time(); # 1816| op->o_do_not_cache = 1; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:2140: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 2138| op->o_ndn = op->o_bd->be_rootndn; # 2139| sc.sc_response = fetch_queryId_cb; # 2140|-> op->o_callback = ≻ # 2141| # 2142| for ( s = 0; !BER_BVISNULL( &entryUUIDs[ s ] ); s++ ) { Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:2269: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 2267| op->o_ndn = op->o_bd->be_rootndn; # 2268| sc.sc_response = fetch_queryId_cb; # 2269|-> op->o_callback = ≻ # 2270| # 2271| rc = op->o_bd->be_search( op, &rs ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:2620: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 2618| op->o_dn = op->o_bd->be_rootdn; # 2619| op->o_ndn = op->o_bd->be_rootndn; # 2620|-> op->o_callback = &cb; # 2621| Debug( pcache_debug, "pc_setpw: CACHING BIND for %s\n", # 2622| op->o_req_dn.bv_val ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:3424: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 3422| op->o_tag = LDAP_REQ_SEARCH; # 3423| op->o_protocol = LDAP_VERSION3; # 3424|-> op->o_callback = &cb; # 3425| op->o_do_not_cache = 1; # 3426| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c: scope_hint: In function ‘consistency_check’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:3589:49: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ttl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:49: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:31: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:3552:17: note: in expansion of macro ‘Debug’ # 3587| expires = query; # 3588| query->qtemp = NULL; # 3589|-> } else if ( !templ->ttr && query->expiry_time > ttl ) { # 3590| /* We don't need to check for refreshes, and this # 3591| * query's expiry is too new, and all subsequent queries Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c: scope_hint: In function ‘consistency_check’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:3589:49: warning[-Wmaybe-uninitialized]: ‘ttl’ may be used uninitialized # 3589 | } else if ( !templ->ttr && query->expiry_time > ttl ) { # | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:3537:24: note: ‘ttl’ was declared here # 3537 | time_t ttl; # | ^~~ # 3587| expires = query; # 3588| query->qtemp = NULL; # 3589|-> } else if ( !templ->ttr && query->expiry_time > ttl ) { # 3590| /* We don't need to check for refreshes, and this # 3591| * query's expiry is too new, and all subsequent queries Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:3685:30: warning[-Wmissing-braces]: missing braces around initializer # 3685 | static ConfigTable pccfg[] = { # | ^ # 3683| static ConfigCfAdd pc_cfadd; # 3684| # 3685|-> static ConfigTable pccfg[] = { # 3686| { "pcache", "backend> <max_entries> <numattrsets> <entry limit> " # 3687| "<cycle_time", Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c: scope_hint: In function ‘pcache_monitor_free’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/pcache.c:5488:25: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 5488 | int rc; # | ^~ # 5486| char textbuf[ SLAP_TEXT_BUFLEN ]; # 5487| # 5488|-> int rc; # 5489| # 5490| /* NOTE: if slap_shutdown != 0, priv might have already been freed */ Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:451:35: warning[-Wmissing-braces]: missing braces around initializer # 451 | static ConfigTable ppolicycfg[] = { # | ^ # 449| static ConfigDriver ppolicy_cf_default, ppolicy_cf_checkmod; # 450| # 451|-> static ConfigTable ppolicycfg[] = { # 452| { "ppolicy_default", "policyDN", 2, 2, 0, # 453| ARG_DN|ARG_QUOTE|ARG_MAGIC|PPOLICY_DEFAULT, ppolicy_cf_default, Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c: scope_hint: In function ‘ppolicy_get’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:1168:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘bd’ # 1166| defaultpol: # 1167| if ( pe ) { # 1168|-> op->o_bd = bd; # 1169| be_entry_release_r( op, pe ); # 1170| op->o_bd = bd_orig; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c: scope_hint: In function ‘ppolicy_get’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:1168:26: warning[-Wmaybe-uninitialized]: ‘bd’ may be used uninitialized # 1168 | op->o_bd = bd; # | ~~~~~~~~~^~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:958:20: note: ‘bd’ was declared here # 958 | BackendDB *bd, *bd_orig = op->o_bd; # | ^~ # 1166| defaultpol: # 1167| if ( pe ) { # 1168|-> op->o_bd = bd; # 1169| be_entry_release_r( op, pe ); # 1170| op->o_bd = bd_orig; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c: scope_hint: In function ‘check_password_quality’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:1280:29: warning[-Wunused-variable]: unused variable ‘prog’ # 1280 | check_func *prog; # | ^~~~ # 1278| if (pp->pwdUseCheckModule) { # 1279| #ifdef SLAPD_MODULES # 1280|-> check_func *prog; # 1281| # 1282| if ( !pi->pwdCheckFunc ) { Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c: scope_hint: In function ‘ppolicy_bind_response’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:1575:95: warning[-Wformat-truncation=]: ‘__snprintf_chk’ output may be truncated before the last format character # 1575 | snprintf( timestamp_usec.bv_val + timestamp_usec.bv_len-1, sizeof(".123456Z"), ".%06dZ", now_usec.tt_nsec / 1000 ); # | ^ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 9 and 10 bytes into a destination of size 9 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 1573| timestamp_usec.bv_val = nowstr_usec; # 1574| timestamp_usec.bv_len = timestamp.bv_len; # 1575|-> snprintf( timestamp_usec.bv_val + timestamp_usec.bv_len-1, sizeof(".123456Z"), ".%06dZ", now_usec.tt_nsec / 1000 ); # 1576| timestamp_usec.bv_len += STRLENOF(".123456"); # 1577| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c: scope_hint: In function ‘ppolicy_account_usability_entry_cb’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:2057:22: warning[-Wunused-variable]: unused variable ‘ctrl’ # 2057 | LDAPControl *ctrl = NULL; # | ^~~~ # 2055| slap_overinst *on = op->o_callback->sc_private; # 2056| BackendInfo *bi = op->o_bd->bd_info; # 2057|-> LDAPControl *ctrl = NULL; # 2058| PassPolicy pp; # 2059| Attribute *a; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:2103:39: warning[deadcode.DeadStores]: Although the value stored to 'a' is used in the enclosing expression, the value is never actually read from 'a' # 2101| } # 2102| } # 2103|-> if ( !isExpired && pp.pwdMaxIdle && (a = attr_find( e->e_attrs, ad_pwdLastSuccess )) ) { # 2104| time_t lastbindtime = pwtime; # 2105| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:3120:5: warning[deadcode.DeadStores]: Value stored to 'modtail' is never read # 3118| mods->sml_next = NULL; # 3119| modtail->sml_next = mods; # 3120|-> modtail = mods; # 3121| # 3122| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/ppolicy.c:3174:4: warning[deadcode.DeadStores]: Value stored to 'modtail' is never read # 3172| mods->sml_next = NULL; # 3173| modtail->sml_next = mods; # 3174|-> modtail = mods; # 3175| } # 3176| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c:111:34: warning[-Wmissing-braces]: missing braces around initializer # 111 | static ConfigTable refintcfg[] = { # | ^ # 109| static ConfigDriver refint_cf_gen; # 110| # 111|-> static ConfigTable refintcfg[] = { # 112| { "refint_attributes", "attribute...", 2, 0, 0, # 113| ARG_MAGIC|REFINT_ATTRS, refint_cf_gen, Error: COMPILER_WARNING (CWE-681): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c: scope_hint: In function ‘refint_search_cb’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c:562:96: warning[-Wpointer-sign]: pointer targets in passing argument 4 of ‘attr_valfind’ differ in signedness # 562 | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH, &rq->oldndn, &i, NULL ); # | ^~ # | | # | int * openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1181: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c:22: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/proto-slap.h:282:19: note: expected ‘unsigned int *’ but argument is of type ‘int *’ # 282 | unsigned *slot, # | ~~~~~~~~~~^~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_cdefs.h:32:33: note: in definition of macro ‘LDAP_P’ # 32 | # define LDAP_P(protos) protos # | ^~~~~~ # 560| is_exact = attr_valfind( a, # 561| SLAP_MR_EQUALITY|SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH| # 562|-> SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH, &rq->oldndn, &i, NULL ); # 563| if ( is_exact == LDAP_SUCCESS ) { # 564| na = op->o_tmpcalloc( 1, Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c: scope_hint: In function ‘refint_response’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/refint.c:952:23: warning[-Wunused-variable]: unused variable ‘ip’ # 952 | refint_attrs *ip; # | ^~ # 950| refint_data *id; # 951| refint_q *rq; # 952|-> refint_attrs *ip; # 953| int ac; # 954| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/remoteauth.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/remoteauth.c:96:38: warning[-Wmissing-braces]: missing braces around initializer # 96 | static ConfigTable remoteauthcfg[] = { # | ^ # 94| static ConfigDriver remoteauth_cf_gen; # 95| # 96|-> static ConfigTable remoteauthcfg[] = { # 97| { "remoteauth_mapping", "mapping between domain and realm", 2, 3, 0, # 98| ARG_MAGIC|REMOTE_AUTH_MAPPING, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/remoteauth.c:252:14: warning[deadcode.DeadStores]: Value stored to 'pin' during its initialization is never read # 250| break; # 251| case REMOTE_AUTH_TLS_PIN: { # 252|-> ad_pin *pin = ad->pins; # 253| for ( pin = ad->pins; pin; pin = pin->next ) { # 254| bv.bv_val = ch_malloc( strlen( pin->hostname ) + Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/remoteauth.c:291:21: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'map') # 289| # 290| if ( pmap ) { # 291|-> pmap->next = map->next; # 292| map->next = NULL; # 293| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/remoteauth.c: scope_hint: In function ‘remoteauth_cf_gen’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/remoteauth.c:291:73: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘map’ # 289| # 290| if ( pmap ) { # 291|-> pmap->next = map->next; # 292| map->next = NULL; # 293| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/retcode.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/retcode.c:790:30: warning[-Wmissing-braces]: missing braces around initializer # 790 | static ConfigTable rccfg[] = { # | ^ # 788| static ConfigDriver rc_cf_gen; # 789| # 790|-> static ConfigTable rccfg[] = { # 791| { "retcode-parent", "dn", # 792| 2, 2, 0, ARG_MAGIC|ARG_DN|ARG_QUOTE|RC_PARENT, rc_cf_gen, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/retcode.c:872:5: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read # 870| ptr = bv.bv_val = ch_malloc( bv.bv_len + 1 ); # 871| ptr = lutil_strcopy( ptr, buf ); # 872|-> ptr = lutil_strncopy( ptr, rdi->rdi_line.bv_val, rdi->rdi_line.bv_len ); # 873| ber_bvarray_add( &c->rvalue_vals, &bv ); # 874| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c: scope_hint: In function ‘rwm_op_add’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c:280:33: warning[-Wunused-but-set-variable]: variable ‘i’ set but not used # 280 | i; # | ^ # 278| # 279| int rc, # 280|-> i; # 281| Attribute **ap = NULL; # 282| char *olddn = op->o_req_dn.bv_val; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c:301:8: warning[deadcode.DeadStores]: Value stored to 'i' is never read # 299| /* Count number of attributes in entry */ # 300| isupdate = be_shadow_update( op ); # 301|-> for ( i = 0, ap = &op->oq_add.rs_e->e_attrs; *ap; ) { # 302| Attribute *a; # 303| Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c: scope_hint: At top level openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c:1946:31: warning[-Wmissing-braces]: missing braces around initializer # 1946 | static ConfigTable rwmcfg[] = { # | ^ # 1944| static ConfigDriver rwm_cf_gen; # 1945| # 1946|-> static ConfigTable rwmcfg[] = { # 1947| { "rwm-rewrite", "rewrite", # 1948| 2, 0, STRLENOF("rwm-rewrite"), Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwm.c:2349:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2347| # 2348| rwmap->rwm_rw = NULL; # 2349|-> rc = rwm_info_init( &rwmap->rwm_rw ); # 2350| # 2351| for ( i = 0; i < c->valx; i++ ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwmconf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/rwmmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1034:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 1032| tag = ber_next_element( ber, &len, end )) # 1033| { # 1034|-> tag = ber_skip_tag( ber, &len ); # 1035| ber_skip_data( ber, len ); # 1036| ++count; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1057:8: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 1055| const char *text; # 1056| # 1057|-> if (( tag = ber_scanf( ber, "{" )) == LBER_ERROR ) { # 1058| rs->sr_text = "serverSort control: decoding error"; # 1059| rs->sr_err = LDAP_PROTOCOL_ERROR; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1063:8: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 1061| } # 1062| # 1063|-> if (( tag = ber_scanf( ber, "m", &attr )) == LBER_ERROR ) { # 1064| rs->sr_text = "serverSort control: attribute decoding error"; # 1065| rs->sr_err = LDAP_PROTOCOL_ERROR; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1071:9: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 1069| tag = ber_peek_tag( ber, &len ); # 1070| if ( tag == LDAP_MATCHRULE_IDENTIFIER ) { # 1071|-> if (( tag = ber_scanf( ber, "m", &matchrule )) == LBER_ERROR ) { # 1072| rs->sr_text = "serverSort control: matchrule decoding error"; # 1073| rs->sr_err = LDAP_PROTOCOL_ERROR; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1080:9: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 1078| # 1079| if ( tag == LDAP_REVERSEORDER_IDENTIFIER ) { # 1080|-> if (( tag = ber_scanf( ber, "b", &reverse )) == LBER_ERROR ) { # 1081| rs->sr_text = "serverSort control: reverse decoding error"; # 1082| rs->sr_err = LDAP_PROTOCOL_ERROR; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1087:8: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 1085| } # 1086| # 1087|-> if (( tag = ber_scanf( ber, "}" )) == LBER_ERROR ) { # 1088| rs->sr_text = "serverSort control: decoding error"; # 1089| rs->sr_err = LDAP_PROTOCOL_ERROR; Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/sssvlv.c:1281:35: warning[-Wmissing-braces]: missing braces around initializer # 1281 | static ConfigTable sssvlv_cfg[] = { # | ^ # 1279| } # 1280| # 1281|-> static ConfigTable sssvlv_cfg[] = { # 1282| { "sssvlv-max", "num", # 1283| 2, 2, 0, ARG_INT|ARG_OFFSET, Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_findbase’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:500:21: warning[-Wunused-but-set-variable]: variable ‘rc’ set but not used # 500 | int rc; # | ^~ # 498| Operation fop; # 499| SlapReply frs = { REP_RESULT }; # 500|-> int rc; # 501| # 502| fc->fss->s_flags ^= PS_FIND_BASE; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:530:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 528| # 529| Debug( LDAP_DEBUG_SYNC, "%s syncprov_findbase: searching\n", op->o_log_prefix ); # 530|-> rc = fop.o_bd->be_search( &fop, &frs ); # 531| } else { # 532| ldap_pvt_thread_mutex_unlock( &fc->fss->s_mutex ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:540:17: warning[core.NullDereference]: Access to field 'bv_len' results in a dereference of an undefined pointer value (loaded from field 'fdn') # 538| switch ( fc->fss->s_op->ors_scope ) { # 539| case LDAP_SCOPE_BASE: # 540|-> fc->fscope = dn_match( fc->fdn, &fc->fss->s_base ); # 541| break; # 542| case LDAP_SCOPE_ONELEVEL: { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:544:4: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 542| case LDAP_SCOPE_ONELEVEL: { # 543| struct berval pdn; # 544|-> dnParent( fc->fdn, &pdn ); # 545| fc->fscope = dn_match( &pdn, &fc->fss->s_base ); # 546| break; } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:548:17: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 546| break; } # 547| case LDAP_SCOPE_SUBTREE: # 548|-> fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base ); # 549| break; # 550| case LDAP_SCOPE_SUBORDINATE: Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:551:17: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 549| break; # 550| case LDAP_SCOPE_SUBORDINATE: # 551|-> fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base ) && # 552| !dn_match( fc->fdn, &fc->fss->s_base ); # 553| break; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_findcsn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:683:23: warning[-Wunused-but-set-variable]: variable ‘srs’ set but not used # 683 | sync_control *srs = NULL; # | ^~~ # 681| AttributeAssertion eq = ATTRIBUTEASSERTION_INIT; # 682| fpres_cookie pcookie; # 683|-> sync_control *srs = NULL; # 684| struct slap_limits_set fc_limits; # 685| int i, rc = LDAP_SUCCESS, findcsn_retry = 1; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:689:3: warning[deadcode.DeadStores]: Value stored to 'srs' is never read # 687| # 688| if ( mode != FIND_MAXCSN ) { # 689|-> srs = op->o_controls[slap_cids.sc_LDAPsync]; # 690| } # 691| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:734:19: warning[core.uninitialized.ArraySubscript]: Array subscript is undefined # 732| return LDAP_NO_SUCH_OBJECT; # 733| } # 734|-> cf.f_av_value = si->si_ctxcsn[maxid]; # 735| fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ), # 736| "(entryCSN>=%s)", cf.f_av_value.bv_val ); Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_findcsn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:734:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘maxid’ # 732| return LDAP_NO_SUCH_OBJECT; # 733| } # 734|-> cf.f_av_value = si->si_ctxcsn[maxid]; # 735| fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ), # 736| "(entryCSN>=%s)", cf.f_av_value.bv_val ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_findcsn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:734:46: warning[-Wmaybe-uninitialized]: ‘maxid’ may be used uninitialized # 734 | cf.f_av_value = si->si_ctxcsn[maxid]; # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:686:13: note: ‘maxid’ was declared here # 686 | int maxid; # | ^~~~~ # 732| return LDAP_NO_SUCH_OBJECT; # 733| } # 734|-> cf.f_av_value = si->si_ctxcsn[maxid]; # 735| fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ), # 736| "(entryCSN>=%s)", cf.f_av_value.bv_val ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:1330: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1328| if ( !SLAP_ISOVERLAY( op->o_bd )) { # 1329| db = *op->o_bd; # 1330|-> op->o_bd = &db; # 1331| } # 1332| rc = overlay_entry_get_ov( op, fc.fdn, NULL, NULL, 0, &e, on ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:1364:21: warning[core.NullDereference]: Access to field 'e_ocflags' results in a dereference of a null pointer (loaded from variable 'e') # 1362| ber_dupbv_x( &opc->sndn, &e->e_nname, op->o_tmpmemctx ); # 1363| } # 1364|-> opc->sreference = is_entry_referral( e ); # 1365| a = attr_find( e->e_attrs, slap_schema.si_ad_entryUUID ); # 1366| if ( a ) Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:2020:21: warning[-Wunused-variable]: unused variable ‘se’ # 2020 | slog_entry *se; # | ^~ # 2018| BerVarray uuids, csns; # 2019| struct berval uuid[2] = {}, csn[2] = {}; # 2020|-> slog_entry *se; # 2021| TAvlnode *entry; # 2022| char cbuf[LDAP_PVT_CSNSTR_BUFSIZE]; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:2022:14: warning[-Wunused-variable]: unused variable ‘cbuf’ # 2022 | char cbuf[LDAP_PVT_CSNSTR_BUFSIZE]; # | ^~~~ # 2020| slog_entry *se; # 2021| TAvlnode *entry; # 2022|-> char cbuf[LDAP_PVT_CSNSTR_BUFSIZE]; # 2023| struct berval delcsn[2]; # 2024| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_play_sessionlog’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:2023:23: warning[-Wunused-variable]: unused variable ‘delcsn’ # 2023 | struct berval delcsn[2]; # | ^~~~~~ # 2021| TAvlnode *entry; # 2022| char cbuf[LDAP_PVT_CSNSTR_BUFSIZE]; # 2023|-> struct berval delcsn[2]; # 2024| # 2025| ldap_pvt_thread_rdwr_wlock( &sl->sl_mutex ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:2037:20: warning[-Wmaybe-uninitialized]: ‘minsid’ may be used uninitialized # 2037 | if ( minsid < sl->sl_sids[i] ) { # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_op_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3132:13: note: ‘minsid’ was declared here # 3132 | int minsid, maxsid; # | ^~~~~~ # 2035| for ( i=0; i<sl->sl_numcsns; i++ ) { # 2036| /* SID not present == new enough */ # 2037|-> if ( minsid < sl->sl_sids[i] ) { # 2038| do_play = 1; # 2039| break; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_op_response’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:2467:22: warning[-Wunused-variable]: unused variable ‘sm’ # 2467 | syncmatches *sm; # | ^~ # 2465| slap_overinst *on = opc->son; # 2466| syncprov_info_t *si = on->on_bi.bi_private; # 2467|-> syncmatches *sm; # 2468| # 2469| if ( rs->sr_err == LDAP_SUCCESS ) Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_op_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3251:29: warning[-Wunused-variable]: unused variable ‘sl’ # 3251 | sessionlog *sl; # | ^~ # 3249| /* If we have a cookie, handle the PRESENT lookups */ # 3250| if ( srs->sr_state.ctxcsn ) { # 3251|-> sessionlog *sl; # 3252| int i, j; # 3253| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: In function ‘syncprov_op_search’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3357:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘maxcsn.bv_val’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3145:18: note: in expansion of macro ‘ors_deref’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3356:22: note: in expansion of macro ‘BER_BVISEMPTY’ # 3355| } # 3356| if ( BER_BVISEMPTY( &mincsn )) { # 3357|-> mincsn = maxcsn; # 3358| minsid = maxsid; # 3359| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3358:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 3356| if ( BER_BVISEMPTY( &mincsn )) { # 3357| mincsn = maxcsn; # 3358|-> minsid = maxsid; # 3359| } # 3360| Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c: scope_hint: At top level openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:3695:30: warning[-Wmissing-braces]: missing braces around initializer # 3695 | static ConfigTable spcfg[] = { # | ^ # 3693| static ConfigDriver sp_cf_gen; # 3694| # 3695|-> static ConfigTable spcfg[] = { # 3696| { "syncprov-checkpoint", "ops> <minutes", 3, 3, 0, ARG_MAGIC|SP_CHKPT, # 3697| sp_cf_gen, "( OLcfgOvAt:1.1 NAME 'olcSpCheckpoint' " Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:4152:24: warning[deadcode.DeadStores]: Although the value stored to 'sonext' is used in the enclosing expression, the value is never actually read from 'sonext' # 4150| if ( !slapd_shutdown ) { # 4151| ldap_pvt_thread_mutex_lock( &si->si_ops_mutex ); # 4152|-> for ( so=si->si_ops, sonext=so; so; so=sonext ) { # 4153| SlapReply rs = {REP_RESULT}; # 4154| rs.sr_err = LDAP_UNAVAILABLE; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/syncprov.c:4292:8: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 4290| ber_init2( ber, &ctrl->ldctl_value, 0 ); # 4291| # 4292|-> if ( (tag = ber_scanf( ber, "{i" /*}*/, &mode )) == LBER_ERROR ) { # 4293| rs->sr_text = "Sync control : mode decoding error"; # 4294| return LDAP_PROTOCOL_ERROR; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c:58:39: warning[-Wmissing-braces]: missing braces around initializer # 58 | static ConfigTable translucentcfg[] = { # | ^ # 56| }; # 57| # 58|-> static ConfigTable translucentcfg[] = { # 59| { "translucent_strict", "on|off", 1, 2, 0, # 60| ARG_ON_OFF|ARG_OFFSET, Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c:1272: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1270| sc.sc_response = slap_null_cb; # 1271| save_cb = op->o_callback; # 1272|-> op->o_callback = ≻ # 1273| } # 1274| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c:1282:18: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 1280| # 1281| if (ov->bind_local) { # 1282|-> op->o_callback = save_cb; # 1283| if (rc != LDAP_SUCCESS) { # 1284| rc = SLAP_CB_CONTINUE; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c: scope_hint: In function ‘translucent_bind’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c:1282:32: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘save_cb’ # 1280| # 1281| if (ov->bind_local) { # 1282|-> op->o_callback = save_cb; # 1283| if (rc != LDAP_SUCCESS) { # 1284| rc = SLAP_CB_CONTINUE; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c: scope_hint: In function ‘translucent_bind’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c:1282:32: warning[-Wmaybe-uninitialized]: ‘save_cb’ may be used uninitialized # 1282 | op->o_callback = save_cb; # | ~~~~~~~~~~~~~~~^~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/translucent.c:1257:36: note: ‘save_cb’ was declared here # 1257 | slap_callback sc = { 0 }, *save_cb; # | ^~~~~~~ # 1280| # 1281| if (ov->bind_local) { # 1282|-> op->o_callback = save_cb; # 1283| if (rc != LDAP_SUCCESS) { # 1284| rc = SLAP_CB_CONTINUE; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:89:34: warning[-Wmissing-braces]: missing braces around initializer # 89 | static ConfigTable uniquecfg[] = { # | ^ # 87| static ConfigDriver unique_cf_uri; # 88| # 89|-> static ConfigTable uniquecfg[] = { # 90| { "unique_base", "basedn", 2, 2, 0, ARG_DN|ARG_QUOTE|ARG_MAGIC|UNIQUE_BASE, # 91| unique_cf_base, "( OLcfgOvAt:10.1 NAME 'olcUniqueBase' " Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c: scope_hint: In function ‘unique_new_domain’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:335:13: warning[-Wunused-but-set-variable]: variable ‘uri_err’ set but not used # 335 | int uri_err = 0; # | ^~~~~~~ # 333| char *uri_start; # 334| int rc = LDAP_SUCCESS; # 335|-> int uri_err = 0; # 336| unique_domain * domain; # 337| LDAPURLDesc *url_desc, *url_descs = NULL; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:384:4: warning[deadcode.DeadStores]: Value stored to 'uri_err' is never read # 382| if ( rc ) { # 383| rc = ARG_BAD_CONF; # 384|-> uri_err = 1; # 385| goto exit; # 386| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:475:13: warning[core.NullDereference]: Dereference of null pointer # 473| if ( !legacy->uri ) # 474| unique_new_domain_uri_basic ( &legacy->uri, c ); # 475|-> ch_free ( legacy->uri->dn.bv_val ); # 476| ch_free ( legacy->uri->ndn.bv_val ); # 477| legacy->uri->dn = c->value_dn; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:627:9: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'attrp') # 625| } # 626| for ( attrp = &legacy->uri->attrs; # 627|-> *attrp; # 628| attrp = &(*attrp)->next ) ; # 629| *attrp = reverse_attrs; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:769:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 767| break; # 768| } # 769|-> rc = 0; # 770| if ( c->line ) rc = unique_new_domain ( &domain, c->line, c ); # 771| else rc = unique_new_domain ( &domain, c->argv[1], c ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/unique.c:997: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 995| cb.sc_response = (slap_response*)count_attr_cb; # 996| cb.sc_private = &uq; # 997|-> nop->o_callback = &cb; # 998| nop->o_tag = LDAP_REQ_SEARCH; # 999| nop->ors_scope = scope; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/valsort.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-665): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/valsort.c:58:38: warning[-Wmissing-braces]: missing braces around initializer # 58 | static ConfigTable valsort_cfats[] = { # | ^ # 56| static ConfigDriver valsort_cf_func; # 57| # 58|-> static ConfigTable valsort_cfats[] = { # 59| { "valsort-attr", "attribute> <dn> <sort-type", 4, 5, 0, ARG_MAGIC, # 60| valsort_cf_func, "( OLcfgOvAt:5.1 NAME 'olcValSortAttr' " Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/valsort.c:146:23: warning[core.NullDereference]: Access to field 'vi_next' results in a dereference of a null pointer (loaded from variable 'vi') # 144| vi = *prev; vi && i<c->valx; # 145| prev = &vi->vi_next, vi = vi->vi_next, i++ ); # 146|-> (*prev)->vi_next = vi->vi_next; # 147| ch_free( vi->vi_dn.bv_val ); # 148| ch_free( vi ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/valsort.c:532:8: warning[deadcode.DeadStores]: Although the value stored to 'tag' is used in the enclosing expression, the value is never actually read from 'tag' # 530| # 531| ber_init2( ber, &ctrl->ldctl_value, 0 ); # 532|-> if (( tag = ber_scanf( ber, "{b}", &flag )) == LBER_ERROR ) { # 533| rs->sr_text = "valSort control: flag decoding error"; # 534| return LDAP_PROTOCOL_ERROR; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/overlays/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: ../liboverlays.a 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c: scope_hint: In function ‘passwd_extop’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:102:46: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘idNul’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:17: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:32: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:88:45: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:49: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:94:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:162:62: note: in definition of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:94:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:101:23: note: in expansion of macro ‘BER_BVISNULL’ # 100| if ( rs->sr_err != LDAP_SUCCESS ) { # 101| if ( !BER_BVISNULL( &id )) # 102|-> id.bv_val[id.bv_len] = idNul; # 103| return rs->sr_err; # 104| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:108:24: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 106| if ( !BER_BVISEMPTY( &id ) ) { # 107| rs->sr_err = dnPrettyNormal( NULL, &id, &dn, &ndn, op->o_tmpmemctx ); # 108|-> id.bv_val[id.bv_len] = idNul; # 109| if ( rs->sr_err != LDAP_SUCCESS ) { # 110| rs->sr_text = "Invalid DN"; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:108:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘idNul’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:88:45: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ldap_log.h:185:9: note: in expansion of macro ‘Log’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:89:17: note: in expansion of macro ‘Debug’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:106:15: note: in expansion of macro ‘BER_BVISEMPTY’ # 106| if ( !BER_BVISEMPTY( &id ) ) { # 107| rs->sr_err = dnPrettyNormal( NULL, &id, &dn, &ndn, op->o_tmpmemctx ); # 108|-> id.bv_val[id.bv_len] = idNul; # 109| if ( rs->sr_err != LDAP_SUCCESS ) { # 110| rs->sr_text = "Invalid DN"; Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c: scope_hint: In function ‘passwd_extop’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:108:38: warning[-Wmaybe-uninitialized]: ‘idNul’ may be used uninitialized # 108 | id.bv_val[id.bv_len] = idNul; # | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:59:24: note: ‘idNul’ was declared here # 59 | char **hashes, idNul; # | ^~~~~ # 106| if ( !BER_BVISEMPTY( &id ) ) { # 107| rs->sr_err = dnPrettyNormal( NULL, &id, &dn, &ndn, op->o_tmpmemctx ); # 108|-> id.bv_val[id.bv_len] = idNul; # 109| if ( rs->sr_err != LDAP_SUCCESS ) { # 110| rs->sr_text = "Invalid DN"; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:297: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 295| # 296| op->o_tag = LDAP_REQ_MODIFY; # 297|-> op->o_callback = &cb; # 298| op->orm_modlist = qpw->rs_mods; # 299| op->orm_no_opattrs = 0; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/passwd.c:458:3: warning[deadcode.DeadStores]: Value stored to 'tag' is never read # 456| } # 457| # 458|-> tag = ber_peek_tag( ber, &len ); # 459| } # 460| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/proxyp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/referral.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:349:3: warning[core.NullDereference]: Access to field 'c_writers' results in a dereference of a null pointer (loaded from variable 'conn') # 347| ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex ); # 348| if (( op->o_abandon && !op->o_cancel ) || !connection_valid( conn ) || # 349|-> conn->c_writers < 0 ) { # 350| ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex ); # 351| return 0; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:471:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 469| assert( c != NULL ); # 470| # 471|-> rc = ber_printf( ber, "{s" /*}*/, c->ldctl_oid ); # 472| # 473| if( c->ldctl_iscritical ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1261:28: warning[core.NullDereference]: Array access (from variable 'e_flags') results in a null pointer dereference # 1259| } # 1260| # 1261|-> if ( op->o_vrFilter && e_flags[j][i] == 0 ){ # 1262| continue; # 1263| } Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c: scope_hint: In function ‘slap_send_search_entry’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1261:63: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘e_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:38: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2147:12: note: in definition of macro ‘SLAP_USERATTRS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1145:41: note: in expansion of macro ‘sr_attr_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:3387: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1250:40: note: in expansion of macro ‘access_allowed’ # 1259| } # 1260| # 1261|-> if ( op->o_vrFilter && e_flags[j][i] == 0 ){ # 1262| continue; # 1263| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1268:12: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc' # 1266| first = 0; # 1267| finish = 1; # 1268|-> if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) { # 1269| Debug( LDAP_DEBUG_ANY, # 1270| "send_search_entry: conn %lu ber_printf failed\n", Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1426:28: warning[core.NullDereference]: Array access (from variable 'e_flags') results in a null pointer dereference # 1424| } # 1425| # 1426|-> if ( op->o_vrFilter && e_flags[j][i] == 0 ){ # 1427| continue; # 1428| } Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1426:63: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘e_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2147:12: note: in definition of macro ‘SLAP_USERATTRS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1145:41: note: in expansion of macro ‘sr_attr_flags’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1389:24: note: in expansion of macro ‘access_allowed’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1415:40: note: in expansion of macro ‘access_allowed’ # 1424| } # 1425| # 1426|-> if ( op->o_vrFilter && e_flags[j][i] == 0 ){ # 1427| continue; # 1428| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1430:11: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc' # 1428| } # 1429| # 1430|-> if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) { # 1431| Debug( LDAP_DEBUG_ANY, # 1432| "send_search_entry: conn %lu ber_printf failed\n", Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/result.c:1444:9: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc' # 1442| } # 1443| # 1444|-> if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) { # 1445| Debug( LDAP_DEBUG_ANY, # 1446| "send_search_entry: conn %lu ber_printf failed\n", Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/root_dse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/root_dse.c: scope_hint: In function ‘root_dse_info’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/root_dse.c:189:28: warning[-Wunused-variable]: unused variable ‘j’ # 189 | int i, j; # | ^ # 187| struct berval *bv; # 188| #endif # 189|-> int i, j; # 190| char ** supportedSASLMechanisms; # 191| BackendDB *be; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/sasl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c: scope_hint: In function ‘authzValidate’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:318:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 8192 equals destination size # 318 | strncpy( buf, in->bv_val, sizeof( buf ) ); # | ^ # 316| id.bv_len = in->bv_len; # 317| id.bv_val = buf; # 318|-> strncpy( buf, in->bv_val, sizeof( buf ) ); # 319| # 320| rc = slap_parse_user( &id, &user, &realm, &mech ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c: scope_hint: In function ‘authzPrettyNormal’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:630:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 8192 equals destination size # 630 | strncpy( buf, val->bv_val, sizeof( buf ) ); # | ^ # 628| id.bv_len = val->bv_len; # 629| id.bv_val = buf; # 630|-> strncpy( buf, val->bv_val, sizeof( buf ) ); # 631| # 632| rc = slap_parse_user( &id, &user, &realm, &mech ); Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c: scope_hint: In function ‘slap_parseURI’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1062:17: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 8192 equals destination size # 1062 | strncpy( buf, uri->bv_val, sizeof( buf ) ); # | ^ # 1060| id.bv_len = uri->bv_len; # 1061| id.bv_val = buf; # 1062|-> strncpy( buf, uri->bv_val, sizeof( buf ) ); # 1063| # 1064| rc = slap_parse_user( &id, &user, &realm, &mech ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1154:3: warning[deadcode.DeadStores]: Value stored to 'tmp' is never read # 1152| STRLENOF( /* ( */ ")(" /* ) */ ) ); # 1153| tmp = lutil_strncopy( tmp, member_at.bv_val, member_at.bv_len ); # 1154|-> tmp = lutil_strncopy( tmp, "=", STRLENOF( "=" ) ); # 1155| # 1156| return rc; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1353:18: warning[-Wunused-variable]: unused variable ‘line’ # 1353 | char *line; # | ^~~~ # 1351| { # 1352| int rc, i, last; # 1353|-> char *line; # 1354| struct berval bv; # 1355| struct rewrite_info *rw = sasl_rwinfo; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c: scope_hint: In function ‘slap_sasl_rewrite_config’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1354:23: warning[-Wunused-variable]: unused variable ‘bv’ # 1354 | struct berval bv; # | ^~ # 1352| int rc, i, last; # 1353| char *line; # 1354|-> struct berval bv; # 1355| struct rewrite_info *rw = sasl_rwinfo; # 1356| Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1442: warning[uninitvar]: Uninitialized variable: rc # 1440| } # 1441| # 1442|-> return rc; # 1443| } # 1444| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1442:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 1440| } # 1441| # 1442|-> return rc; # 1443| } # 1444| Error: CPPCHECK_WARNING (CWE-909): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1528: error[uninitStructMember]: Uninitialized struct member: sr.sr_match # 1526| } # 1527| # 1528|-> SaslRegexp[i] = sr; # 1529| SaslRegexp[i].sr_match = ch_strdup( match ); # 1530| SaslRegexp[i].sr_replace = ch_strdup( replace ); Error: CPPCHECK_WARNING (CWE-909): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1528: error[uninitStructMember]: Uninitialized struct member: sr.sr_replace # 1526| } # 1527| # 1528|-> SaslRegexp[i] = sr; # 1529| SaslRegexp[i].sr_match = ch_strdup( match ); # 1530| SaslRegexp[i].sr_replace = ch_strdup( replace ); Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1528: error[uninitvar]: Uninitialized variable: sr # 1526| } # 1527| # 1528|-> SaslRegexp[i] = sr; # 1529| SaslRegexp[i].sr_match = ch_strdup( match ); # 1530| SaslRegexp[i].sr_replace = ch_strdup( replace ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:1864:3: warning[deadcode.DeadStores]: Value stored to 'tmp' is never read # 1862| # 1863| tmp = lutil_strcopy( &tmp[op.ors_filterstr.bv_len], assertDN->bv_val ); # 1864|-> tmp = lutil_strcopy( tmp, /*"(("*/ "))" ); # 1865| # 1866| /* pass opx because str2filter_x may (and does) use o_tmpmfuncs */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/saslauthz.c:2076:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 2074| /* Must run an internal search. */ # 2075| if ( op.ors_filter == NULL ) { # 2076|-> rc = LDAP_FILTER_ERROR; # 2077| goto FINISHED; # 2078| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_check.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_init.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_init.c:2728: warning[uninitvar]: Uninitialized variable: rc # 2726| slap_sl_free( itmp.bv_val, ctx ); # 2727| } # 2728|-> return rc; # 2729| } # 2730| Error: CPPCHECK_WARNING (CWE-758): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_init.c:3597: warning[objectIndex]: The address of variable 'zero' might be accessed at non-zero index. # 3595| } # 3596| for ( ; i < len; i++ ) { # 3597|-> sprintf( sptr, "%02X", ptr[i] ); # 3598| sptr += 2; # 3599| } Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_init.c:5303: error[uninitvar]: Uninitialized variable: bv.bv_val # 5301| bv.bv_val = buf; # 5302| # 5303|-> ptr = bv.bv_val; # 5304| ptr = lutil_strncopy( ptr, gt.bv_val, STRLENOF( "YYYYmmddHH" ) ); # 5305| ptr = lutil_strncopy( ptr, >.bv_val[ STRLENOF( "YYYYmmddHH:" ) ], Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_init.c:5400: error[uninitvar]: Uninitialized variable: bv.bv_val # 5398| bv.bv_val = buf; # 5399| # 5400|-> ptr = bv.bv_val; # 5401| ptr = lutil_strncopy( ptr, gt.bv_val, gt.bv_len - 1 ); # 5402| ptr = lutil_strcopy( ptr, ".000000Z#" ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/schema_prep.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/sets.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/sl_malloc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/sl_malloc.c:673: error[legacyUninitvar]: Uninitialized variable: memctx # 671| if ( slapMode & SLAP_TOOL_MODE ) return NULL; # 672| # 673|-> sh = GET_MEMCTX(ldap_pvt_thread_pool_context(), &memctx); # 674| if (sh && ptr >= sh->sh_base && ptr <= sh->sh_end) { # 675| return sh; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:28: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c: scope_hint: In function ‘monitor_subsys_database_modify’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2383:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘be’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2384:34: note: in expansion of macro ‘SLAP_BFLAGS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:656:14: note: in expansion of macro ‘SLAP_MONITOR’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:57: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:649:9: note: in expansion of macro ‘LDAP_STAILQ_FOREACH’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:2384:34: note: in expansion of macro ‘SLAP_BFLAGS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/back-monitor/database.c:656:14: note: in expansion of macro ‘SLAP_MONITOR’ # 2381| #define SLAPO_BFLAG_MASK 0xFF000000U # 2382| # 2383|-> #define SLAP_BFLAGS(be) ((be)->bd_info->bi_flags) # 2384| #define SLAP_MONITOR(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_MONITOR) # 2385| #define SLAP_CONFIG(be) (SLAP_BFLAGS(be) & SLAP_BFLAG_CONFIG) Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c:126:19: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 124| e = str2entry2( buf, checkvals ); # 125| if ( !dbnum ) { # 126|-> slap_DN_strict = prev_DN_strict; # 127| } # 128| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c: scope_hint: In function ‘getrec0’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c:126:40: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘prev_DN_strict’ # 124| e = str2entry2( buf, checkvals ); # 125| if ( !dbnum ) { # 126|-> slap_DN_strict = prev_DN_strict; # 127| } # 128| Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c: scope_hint: In function ‘getrec0’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c:126:40: warning[-Wmaybe-uninitialized]: ‘prev_DN_strict’ may be used uninitialized # 126 | slap_DN_strict = prev_DN_strict; # | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c:115:21: note: ‘prev_DN_strict’ was declared here # 115 | int prev_DN_strict; # | ^~~~~~~~~~~~~~ # 124| e = str2entry2( buf, checkvals ); # 125| if ( !dbnum ) { # 126|-> slap_DN_strict = prev_DN_strict; # 127| } # 128| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapadd.c:485:3: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value # 483| ldap_pvt_thread_cond_signal( &add_cond ); # 484| ldap_pvt_thread_mutex_unlock( &add_mutex ); # 485|-> ldap_pvt_thread_join( thr, NULL ); # 486| } # 487| if ( erec.e ) entry_free( erec.e ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c:203:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 201| switch ( tool ) { # 202| case SLAPADD: # 203|-> if ( strcasecmp( p, "yes" ) == 0 ) { # 204| *mode &= ~SLAP_TOOL_NO_SCHEMA_CHECK; # 205| } else if ( strcasecmp( p, "no" ) == 0 ) { Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c: scope_hint: In function ‘parse_slapopt’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c:203:30: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected /usr/include/string.h:462: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/string.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c:33: included_from: Included from here. /usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null # 201| switch ( tool ) { # 202| case SLAPADD: # 203|-> if ( strcasecmp( p, "yes" ) == 0 ) { # 204| *mode &= ~SLAP_TOOL_NO_SCHEMA_CHECK; # 205| } else if ( strcasecmp( p, "no" ) == 0 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c:221:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 219| switch ( tool ) { # 220| case SLAPADD: # 221|-> if ( strcasecmp( p, "yes" ) == 0 ) { # 222| *mode |= SLAP_TOOL_VALUE_CHECK; # 223| } else if ( strcasecmp( p, "no" ) == 0 ) { Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c:221:30: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected /usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null # 219| switch ( tool ) { # 220| case SLAPADD: # 221|-> if ( strcasecmp( p, "yes" ) == 0 ) { # 222| *mode |= SLAP_TOOL_VALUE_CHECK; # 223| } else if ( strcasecmp( p, "no" ) == 0 ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.c:240:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 238| switch ( tool ) { # 239| case SLAPCAT: # 240|-> if ( strcasecmp( p, "no" ) == 0 ) { # 241| ldif_wrap = LDIF_LINE_WIDTH_MAX; # 242| Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapdn.c: scope_hint: In function ‘slapdn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapdn.c:82:33: warning[-Wanalyzer-null-argument]: use of NULL ‘pdn.bv_val’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapdn.c:36: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapdn.c:80:34: note: in expansion of macro ‘dn_mode’ <built-in>: note: argument 1 of ‘__builtin_puts’ must be non-null # 80| switch ( dn_mode ) { # 81| case SLAP_TOOL_LDAPDN_PRETTY: # 82|-> printf( "%s\n", pdn.bv_val ); # 83| break; # 84| Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapdn.c:86:33: warning[-Wanalyzer-null-argument]: use of NULL ‘ndn.bv_val’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapdn.c:80:34: note: in expansion of macro ‘dn_mode’ <built-in>: note: argument 1 of ‘__builtin_puts’ must be non-null # 84| # 85| case SLAP_TOOL_LDAPDN_NORMAL: # 86|-> printf( "%s\n", ndn.bv_val ); # 87| break; # 88| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c: scope_hint: In function ‘slapi_int_register_plugin_index’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c:171:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pSavePB’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/assert.h:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/portable.h:1184: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c:23: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c:33: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c:160:18: note: in expansion of macro ‘SLAPI_BACKEND_PBLOCK’ # 169| # 170| if ( rc == LDAP_SUCCESS ) { # 171|-> rc = slapi_pblock_set( pSavePB, SLAPI_IBM_PBLOCK, (void *)pPB ); # 172| } # 173| } Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c: scope_hint: In function ‘slapi_int_register_plugin_index’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c:171:30: warning[-Wmaybe-uninitialized]: ‘pSavePB’ may be used uninitialized # 171 | rc = slapi_pblock_set( pSavePB, SLAPI_IBM_PBLOCK, (void *)pPB ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/plugin.c:155:26: note: ‘pSavePB’ was declared here # 155 | Slapi_PBlock *pSavePB; # | ^~~~~~~ # 169| # 170| if ( rc == LDAP_SUCCESS ) { # 171|-> rc = slapi_pblock_set( pSavePB, SLAPI_IBM_PBLOCK, (void *)pPB ); # 172| } # 173| } Error: COMPILER_WARNING (CWE-252): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/printmsg.c: scope_hint: In function ‘slapi_int_log_error’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/printmsg.c:107:17: warning[-Wunused-result]: ignoring return value of ‘lockf’ declared with attribute ‘warn_unused_result’ # 107 | lockf( fileno( fp ), F_ULOCK, 0 ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 105| UnlockFile( fhandle, 0, 0, UINT_MAX, UINT_MAX ); # 106| #else # 107|-> lockf( fileno( fp ), F_ULOCK, 0 ); # 108| #endif # 109| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/slapi_overlay.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/slapi_overlay.c:791:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 789| if ( target != NULL && dn_match( &target->e_nname, gr_ndn ) ) { # 790| e = target; # 791|-> rc = 0; # 792| } else { # 793| rc = be_entry_get_rw( op, gr_ndn, group_oc, group_at, 0, &e ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/slapi_overlay.c:793:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 791| rc = 0; # 792| } else { # 793|-> rc = be_entry_get_rw( op, gr_ndn, group_oc, group_at, 0, &e ); # 794| } # 795| if ( e != NULL ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/slapi_pblock.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/slapi_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/slapi_utils.c:2906: error[legacyUninitvar]: Uninitialized variable: tmpPlugin # 2904| slapi_compute_callback_t *pGetPlugin, *tmpPlugin; # 2905| # 2906|-> rc = slapi_int_get_plugins( frontendDB, SLAPI_PLUGIN_COMPUTE_EVALUATOR_FN, (SLAPI_FUNC **)&tmpPlugin ); # 2907| if ( rc != LDAP_SUCCESS || tmpPlugin == NULL ) { # 2908| /* Nothing to do; front-end should ignore. */ Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapi/version.c:19:19: warning[-Wunused-const-variable=]: ‘__Version’ defined but not used # 19 | static const char __Version[] = # | ^~~~~~~~~ # 17| "COPYING RESTRICTIONS APPLY\n"; # 18| # 19|-> static const char __Version[] = # 20| "@(#) $OpenLDAP: libslapi.la 2.6.7 (" __DATE__ " " __TIME__ ") $\n" # 21| "\topenldap\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapindex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:61:13: warning[-Wunused-but-set-variable]: variable ‘checkvals’ set but not used # 61 | int checkvals, ldifrc; # | ^~~~~~~~~ # 59| Operation *op; # 60| # 61|-> int checkvals, ldifrc; # 62| unsigned long lineno, nextline; # 63| int lmax; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:98:2: warning[deadcode.DeadStores]: Value stored to 'checkvals' is never read # 96| } # 97| # 98|-> checkvals = (slapMode & SLAP_TOOL_QUICK) ? 0 : 1; # 99| # 100| lmax = 0; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:145:21: warning[-Wunused-but-set-variable]: variable ‘is_oc’ set but not used # 145 | int is_oc = 0; # | ^~~~~ # 143| struct berval ndn = BER_BVNULL; # 144| int n; # 145|-> int is_oc = 0; # 146| int local_rc; # 147| int mod_err = 0; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c: scope_hint: In function ‘slapmodify’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:147:21: warning[-Wunused-variable]: unused variable ‘mod_err’ # 147 | int mod_err = 0; # | ^~~~~~~ # 145| int is_oc = 0; # 146| int local_rc; # 147|-> int mod_err = 0; # 148| char *request = "(unknown)"; # 149| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:148:9: warning[deadcode.DeadStores]: Value stored to 'request' during its initialization is never read # 146| int local_rc; # 147| int mod_err = 0; # 148|-> char *request = "(unknown)"; # 149| # 150| ber_str2bv( buf, 0, 0, &rbuf ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:384:18: warning[core.NullDereference]: Dereference of null pointer # 382| if ( local_rc != LDAP_SUCCESS ) { # 383| fprintf( stderr, "%s: DN=\"%s\": unable to %s attr=%s value #%d\n", # 384|-> progname, e->e_dn, pretty ? "prettify" : "validate", # 385| mods.sm_desc->ad_cname.bv_val, i ); # 386| /* handle error */ Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:406:19: warning[core.NullDereference]: Dereference of null pointer # 404| if ( local_rc != LDAP_SUCCESS ) { # 405| fprintf( stderr, "%s: DN=\"%s\": unable to normalize attr=%s value #%d\n", # 406|-> progname, e->e_dn, mods.sm_desc->ad_cname.bv_val, i ); # 407| /* handle error */ # 408| rc = EXIT_FAILURE; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:420:6: warning[deadcode.DeadStores]: Value stored to 'is_oc' is never read # 418| # 419| if ( mods.sm_desc == slap_schema.si_ad_objectClass ) { # 420|-> is_oc = 1; # 421| } # 422| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:450:17: warning[core.NullDereference]: Dereference of null pointer # 448| if ( local_rc != LDAP_SUCCESS ) { # 449| fprintf( stderr, "%s: DN=\"%s\": unable to modify attr=%s\n", # 450|-> progname, e->e_dn, mods.sm_desc->ad_cname.bv_val ); # 451| rc = EXIT_FAILURE; # 452| goto cleanup; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:595:5: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value # 593| # 594| if ( verbose ) # 595|-> fprintf( stderr, "%s: \"%s\" (%08lx)\n", # 596| request, ndn.bv_val, (long) id ); # 597| } else { Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c: scope_hint: In function ‘slapmodify’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:595:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘id’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapcommon.h:21: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:39: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:215:21: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:51: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:302:25: note: in expansion of macro ‘lrop_mods’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:1896:51: note: in definition of macro ‘SLAP_DBFLAGS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:1898:51: note: in expansion of macro ‘SLAP_NOLASTMOD’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:463:22: note: in expansion of macro ‘SLAP_LASTMOD’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:463:35: note: in expansion of macro ‘be’ # 593| # 594| if ( verbose ) # 595|-> fprintf( stderr, "%s: \"%s\" (%08lx)\n", # 596| request, ndn.bv_val, (long) id ); # 597| } else { Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:595:33: warning[-Wmaybe-uninitialized]: ‘id’ may be used uninitialized # 595 | fprintf( stderr, "%s: \"%s\" (%08lx)\n", # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 596 | request, ndn.bv_val, (long) id ); # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:57:12: note: ‘id’ was declared here # 57 | ID id; # | ^~ # 593| # 594| if ( verbose ) # 595|-> fprintf( stderr, "%s: \"%s\" (%08lx)\n", # 596| request, ndn.bv_val, (long) id ); # 597| } else { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:624:8: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 622| # 623| if ( rc == EXIT_SUCCESS ) { # 624|-> rc = slap_tool_update_ctxcsn( progname, sid, &bvtext ); # 625| } # 626| Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:624:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘sid’ # 622| # 623| if ( rc == EXIT_SUCCESS ) { # 624|-> rc = slap_tool_update_ctxcsn( progname, sid, &bvtext ); # 625| } # 626| Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:624:22: warning[-Wmaybe-uninitialized]: ‘sid’ may be used uninitialized # 624 | rc = slap_tool_update_ctxcsn( progname, sid, &bvtext ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapmodify.c:55:23: note: ‘sid’ was declared here # 55 | unsigned long sid; # | ^~~ # 622| # 623| if ( rc == EXIT_SUCCESS ) { # 624|-> rc = slap_tool_update_ctxcsn( progname, sid, &bvtext ); # 625| } # 626| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slapschema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/str2filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/str2filter.c:65:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 63| ber_reset( ber, 1 ); # 64| # 65|-> rc = get_filter( op, ber, &f, &text ); # 66| # 67| done: Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘init_syncrepl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:443:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘attrs’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:54: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:27: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:7229:14: note: in expansion of macro ‘BER_BVISEMPTY’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/slap.h:1900:50: note: in expansion of macro ‘SLAP_DBFLAGS’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:7307:31: note: in expansion of macro ‘SLAP_DBHIDDEN’ # 441| attrs[i++] = ch_strdup( sync_descs[0]->ad_cname.bv_val ); # 442| } # 443|-> attrs[i] = NULL; # 444| } # 445| Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘check_syncprov’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:928:16: warning[-Wunused-variable]: unused variable ‘j’ # 928 | int i, j, changed = 0; # | ^ # 926| Entry e = {0}; # 927| SlapReply rs = {REP_SEARCH}; # 928|-> int i, j, changed = 0; # 929| # 930| /* Look for contextCSN from syncprov overlay. If Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:1378:46: warning[-Wmaybe-uninitialized]: ‘entry’ may be used uninitialized # 1378 | rc = syncrepl_entry( si, op, entry, &modlist, syncstate, syncUUID, NULL ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘do_syncrepl’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:1363:42: note: ‘entry’ declared here # 1363 | Entry *entry; # | ^~~~~ # 1376| rc = syncrepl_dirsync_message( si, op, msg, &modlist, &entry, &syncstate, syncUUID ); # 1377| if ( rc == 0 ) # 1378|-> rc = syncrepl_entry( si, op, entry, &modlist, syncstate, syncUUID, NULL ); # 1379| op->o_tmpfree( syncUUID[0].bv_val, op->o_tmpmemctx ); # 1380| if ( modlist ) Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3205: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 3203| } # 3204| # 3205|-> op->o_callback = &cb; # 3206| slap_op_time( &op->o_time, &op->o_tincr ); # 3207| Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:3886: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 3884| cb.sc_private = si; # 3885| # 3886|-> op->o_callback = &cb; # 3887| op->o_req_dn = si->si_contextdn; # 3888| op->o_req_ndn = si->si_contextdn; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4199: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 4197| # 4198| /* set callback function */ # 4199|-> op->o_callback = &cb; # 4200| cb.sc_response = dn_callback; # 4201| cb.sc_private = &dni; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4659: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 4657| op->o_req_dn = pdn; # 4658| op->o_req_ndn = pdn; # 4659|-> op->o_callback = &cb; # 4660| rs_reinit( &rs_delete, REP_RESULT ); # 4661| op->o_bd->be_delete( op, &rs_delete ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4736: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 4734| cb.sc_private = si; # 4735| # 4736|-> op->o_callback = &cb; # 4737| op->o_tag = LDAP_REQ_SEARCH; # 4738| op->ors_scope = si->si_scope; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_del_nonpresent’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4774:25: warning[-Wunused-but-set-variable]: variable ‘cf’ set but not used # 4774 | Filter *cf, *of; # | ^~ # 4772| si->si_refreshDelete ^= NP_DELETE_ONE; # 4773| } else { # 4774|-> Filter *cf, *of; # 4775| Filter mmf[2]; # 4776| AttributeAssertion mmaa; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4825:40: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘of’ # 4823| rc = be->be_search( op, &rs_search ); # 4824| if ( SLAP_MULTIPROVIDER( op->o_bd )) { # 4825|-> op->ors_filter = of; # 4826| } # 4827| if ( op->ors_filter ) filter_free_x( op, op->ors_filter, 1 ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_del_nonpresent’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4825:40: warning[-Wmaybe-uninitialized]: ‘of’ may be used uninitialized # 4825 | op->ors_filter = of; # | ~~~~~~~~~~~~~~~^~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4774:30: note: ‘of’ was declared here # 4774 | Filter *cf, *of; # | ^~ # 4823| rc = be->be_search( op, &rs_search ); # 4824| if ( SLAP_MULTIPROVIDER( op->o_bd )) { # 4825|-> op->ors_filter = of; # 4826| } # 4827| if ( op->ors_filter ) filter_free_x( op, op->ors_filter, 1 ); Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4860: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 4858| np_list = LDAP_LIST_NEXT( np_list, npe_link ); # 4859| op->o_tag = LDAP_REQ_DELETE; # 4860|-> op->o_callback = &cb; # 4861| cb.sc_response = syncrepl_null_callback; # 4862| cb.sc_private = si; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4918: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 4916| op->o_req_dn = pdn; # 4917| op->o_req_ndn = pdn; # 4918|-> op->o_callback = &cb; # 4919| rs_reinit( &rs_delete, REP_RESULT ); # 4920| /* give it a root privil ? */ Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4966: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 4964| # 4965| op->o_tag = LDAP_REQ_ADD; # 4966|-> op->o_callback = &cb; # 4967| cb.sc_response = syncrepl_null_callback; # 4968| cb.sc_private = NULL; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_add_glue_ancestors’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4966:24: warning[-Wdangling-pointer=]: storing the address of local variable ‘cb’ in ‘op_111(D)->o_callback’ # 4966 | op->o_callback = &cb; # | ~~~~~~~~~~~~~~~^~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4954:23: note: ‘cb’ declared here # 4954 | slap_callback cb = { NULL }; # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:4950:20: note: ‘op’ declared here # 4950 | Operation* op, # | ~~~~~~~~~~~^~ # 4964| # 4965| op->o_tag = LDAP_REQ_ADD; # 4966|-> op->o_callback = &cb; # 4967| cb.sc_response = syncrepl_null_callback; # 4968| cb.sc_private = NULL; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5108: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 5106| # 5107| op->o_tag = LDAP_REQ_ADD; # 5108|-> op->o_callback = &cb; # 5109| cb.sc_response = syncrepl_null_callback; # 5110| cb.sc_private = NULL; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_dsee_update’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5134:23: warning[-Wunused-variable]: unused variable ‘first’ # 5134 | struct berval first = BER_BVNULL; # | ^~~~~ # 5132| Backend *be = op->o_bd; # 5133| Modifications mod; # 5134|-> struct berval first = BER_BVNULL; # 5135| slap_callback cb = { NULL }; # 5136| SlapReply rs_modify = {REP_RESULT}; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5163: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 5161| cb.sc_private = si; # 5162| # 5163|-> op->o_callback = &cb; # 5164| op->o_req_dn = si->si_contextdn; # 5165| op->o_req_ndn = si->si_contextdn; Error: CPPCHECK_WARNING (CWE-562): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5288: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 5286| cb.sc_private = si; # 5287| # 5288|-> op->o_callback = &cb; # 5289| op->o_req_dn = si->si_contextdn; # 5290| op->o_req_ndn = si->si_contextdn; Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘dn_callback’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5802:41: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘is_ctx’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5668:23: note: in expansion of macro ‘BER_BVISNULL’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5732:45: note: in expansion of macro ‘sr_entry’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5801:84: note: in expansion of macro ‘sr_entry’ # 5800| { # 5801| Attribute *old = attrs_exdup( op, dni, rs->sr_entry->e_attrs ); # 5802|-> syncrepl_diff_entry( op, old, # 5803| dni->new_entry->e_attrs, &dni->mods, dni->modlist, # 5804| is_ctx ); Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘dn_callback’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5802:41: warning[-Wmaybe-uninitialized]: ‘is_ctx’ may be used uninitialized # 5802 | syncrepl_diff_entry( op, old, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 5803 | dni->new_entry->e_attrs, &dni->mods, dni->modlist, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 5804 | is_ctx ); # | ~~~~~~~~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:5683:37: note: ‘is_ctx’ was declared here # 5683 | int is_ctx, new_sup = 0; # | ^~~~~~ # 5800| { # 5801| Attribute *old = attrs_exdup( op, dni, rs->sr_entry->e_attrs ); # 5802|-> syncrepl_diff_entry( op, old, # 5803| dni->new_entry->e_attrs, &dni->mods, dni->modlist, # 5804| is_ctx ); Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c: scope_hint: In function ‘syncrepl_monitor_add’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:7119:39: warning[-Wunused-variable]: unused variable ‘bv’ # 7119 | struct berval pndn, pdn, rdn, bv; # | ^~ # 7117| BackendInfo *mi; # 7118| monitor_extra_t *mbe; # 7119|-> struct berval pndn, pdn, rdn, bv; # 7120| char rdnbuf[sizeof("cn=Consumer 999")]; # 7121| Entry *e, *p; Error: CPPCHECK_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syncrepl.c:7600: warning[uninitvar]: Uninitialized variable: *sip # 7598| int i; # 7599| # 7600|-> for ( sip = &c->be->be_syncinfo, i=0; *sip; i++ ) { # 7601| si = *sip; # 7602| if ( c->valx == -1 || i == c->valx ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/syntax.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/txn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/txn.c:368:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller # 366| ldap_pvt_thread_mutex_unlock( &c->c_mutex ); # 367| # 368|-> return rc; # 369| } # 370| Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/txn.c: scope_hint: In function ‘txn_end_extop’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/txn.c:368:16: warning[-Wmaybe-uninitialized]: ‘rc’ may be used uninitialized # 368 | return rc; # | ^~ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/txn.c:156:13: note: ‘rc’ was declared here # 156 | int rc; # | ^~ # 366| ldap_pvt_thread_mutex_unlock( &c->c_mutex ); # 367| # 368|-> return rc; # 369| } # 370| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/user.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/value.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/verbs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/servers/slapd/version.c:15:19: warning[-Wunused-const-variable=]: ‘copyright’ defined but not used # 15 | static const char copyright[] = # | ^~~~~~~~~ # 13| */ # 14| # 15|-> static const char copyright[] = # 16| "Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.\n" # 17| "COPYING RESTRICTIONS APPLY\n"; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/ldif-filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/ldif-filter.c:114:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 112| sort_strings( Strings *ss, size_t offset ) # 113| { # 114|-> qsort( ss->val + offset, ss->len - offset, sizeof(*ss->val), cmp ); # 115| } # 116| Error: GCC_ANALYZER_WARNING (CWE-688): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/ldif-filter.c: scope_hint: In function ‘sort_strings’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/ldif-filter.c:114:9: warning[-Wanalyzer-null-argument]: use of NULL ‘ss.val’ where non-null expected openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/include/ac/stdlib.h:26: included_from: Included from here. openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/ldif-filter.c:21: included_from: Included from here. /usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null # 112| sort_strings( Strings *ss, size_t offset ) # 113| { # 114|-> qsort( ss->val + offset, ss->len - offset, sizeof(*ss->val), cmp ); # 115| } # 116| Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-addel.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-addel.c:40:1: warning[-Wunused-function]: ‘get_add_entry’ declared ‘static’ but never defined # 40 | get_add_entry( char *filename ); # | ^~~~~~~~~~~~~ # 38| # 39| static LDIFRecord * # 40|-> get_add_entry( char *filename ); # 41| # 42| static void Error: COMPILER_WARNING (CWE-1164): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-addel.c:142:1: warning[-Wunused-function]: ‘addmodifyop’ defined but not used # 142 | addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen ) # | ^~~~~~~~~~~ # 140| # 141| static void # 142|-> addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen ) # 143| { # 144| LDAPMod **pmods; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-bind.c:402:12: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc' # 400| } # 401| # 402|-> while ( ( rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ONE, NULL, &res ) ) > 0 ) # 403| { # 404| BerElement *ber; Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-bind.c:413:5: warning[deadcode.DeadStores]: Value stored to 'rc' is never read # 411| switch ( ldap_msgtype( msg ) ) { # 412| case LDAP_RES_SEARCH_ENTRY: # 413|-> rc = ldap_get_dn_ber( ld, msg, &ber, &bv ); # 414| dns = realloc( dns, (ndns + 1)*sizeof(char *) ); # 415| if ( !dns ) { Error: GCC_ANALYZER_WARNING (CWE-415): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-bind.c: scope_hint: In function ‘do_base’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-bind.c:423:49: warning[-Wanalyzer-double-free]: double-‘free’ of ‘creds’ # 421| struct berval **values = ldap_get_values_len( ld, msg, pwattr ); # 422| # 423|-> creds = realloc( creds, (ndns + 1)*sizeof(struct berval) ); # 424| if ( !creds ) { # 425| tester_error( "realloc failed" ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-common.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-common.c: scope_hint: In function ‘tester_init_ld’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-common.c:478:13: warning[-Wmaybe-uninitialized]: ‘rc’ may be used uninitialized # 478 | int rc, do_retry = config->retries; # | ^~ # 476| { # 477| LDAP *ld; # 478|-> int rc, do_retry = config->retries; # 479| int version = LDAP_VERSION3; # 480| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-common.c:523:11: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value # 521| } # 522| # 523|-> if ( rc != LDAP_SUCCESS ) { # 524| tester_ldap_error( ld, "ldap_sasl_bind_s", NULL ); # 525| ldap_unbind_ext( ld, NULL, NULL ); Error: GCC_ANALYZER_WARNING (CWE-457): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-common.c: scope_hint: In function ‘tester_init_ld’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-common.c:523:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘rc’ # 521| } # 522| # 523|-> if ( rc != LDAP_SUCCESS ) { # 524| tester_ldap_error( ld, "ldap_sasl_bind_s", NULL ); # 525| ldap_unbind_ext( ld, NULL, NULL ); Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-modify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-modrdn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-modrdn.c: scope_hint: In function ‘do_modrdn’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-modrdn.c:137:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p2’ # 135| p2 = strchr( p1, ',' ); # 136| # 137|-> *p2 = '\0'; # 138| rdns[1] = strdup( entry ); # 139| if ( rdns[1] == NULL ) { Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-modrdn.c:139:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(entry)’ # 137| *p2 = '\0'; # 138| rdns[1] = strdup( entry ); # 139|-> if ( rdns[1] == NULL ) { # 140| tester_error( "strdup failed" ); # 141| exit( EXIT_FAILURE ); Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-modrdn.c:148:15: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(entry)’ # 146| DNs[1][i++] = *p2--; # 147| # 148|-> DNs[1][i] = '\0'; # 149| rdns[0] = strdup( DNs[1] ); # 150| if ( rdns[0] == NULL ) { Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c:128:50: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 8191 bytes into a region of size 8177 # 128 | snprintf(thrstr, BUFSIZ, "tidx: %d says: %s", idx, string); # | ^~ #...... # 277 | thread_verbose(-1, outstr); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 16 and 8207 bytes into a destination of size 8192 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 126| if (!verbose) # 127| return; # 128|-> snprintf(thrstr, BUFSIZ, "tidx: %d says: %s", idx, string); # 129| tester_error( thrstr ); # 130| } Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c: scope_hint: In function ‘do_read.isra.0’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c:128:50: warning[-Wformat-truncation=]: ‘%s’ directive output may be truncated writing up to 8191 bytes into a region of size between 8168 and 8178 # 128 | snprintf(thrstr, BUFSIZ, "tidx: %d says: %s", idx, string); # | ^~ #...... # 666 | thread_verbose( idx, thrstr ); # | ~~~~~~ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 15 and 8216 bytes into a destination of size 8192 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 126| if (!verbose) # 127| return; # 128|-> snprintf(thrstr, BUFSIZ, "tidx: %d says: %s", idx, string); # 129| tester_error( thrstr ); # 130| } Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c:162:26: warning[-Wunused-variable]: unused variable ‘manager’ # 162 | char *manager = NULL; # | ^~~~~~~ # 160| int i; # 161| char *uri = NULL; # 162|-> char *manager = NULL; # 163| struct berval passwd = { 0, NULL }; # 164| char outstr[BUFSIZ]; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c:163:25: warning[-Wunused-variable]: unused variable ‘passwd’ # 163 | struct berval passwd = { 0, NULL }; # | ^~~~~~ # 161| char *uri = NULL; # 162| char *manager = NULL; # 163|-> struct berval passwd = { 0, NULL }; # 164| char outstr[BUFSIZ]; # 165| int ptpass; Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c:268:61: warning[-Wformat-truncation=]: ‘%s’ directive argument is null # 268 | snprintf(outstr, BUFSIZ, "MT Test Start: conns: %d (%s)", noconns, uri); # | ^~ # 266| } # 267| # 268|-> snprintf(outstr, BUFSIZ, "MT Test Start: conns: %d (%s)", noconns, uri); # 269| tester_error(outstr); # 270| snprintf(outstr, BUFSIZ, "Threads: RO: %d RW: %d", threads, rwthreads); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-mtread.c:562:18: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value # 560| } # 561| for( i = 0; i < nvalues; i++) { # 562|-> if (values[i] != NULL) # 563| ldap_memfree( values[i] ); # 564| } Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-read.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-read.c:352:11: warning[core.NullDereference]: Array access (from variable 'msgids') results in a null pointer dereference # 350| /* linear search, bah */ # 351| for ( j = 0; j < i; j++ ) { # 352|-> if ( msgids[ j ] == msgid ) { # 353| msgids[ j ] = -1; # 354| active--; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-search.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-search.c: scope_hint: In function ‘do_random’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-search.c:230:36: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 228| # 229| values = realloc( values, ( nvalues + n + 1 )*sizeof( char * ) ); # 230|-> if ( !values ) { # 231| tester_error( "realloc failed" ); # 232| exit( EXIT_FAILURE ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-search.c:399:11: warning[core.NullDereference]: Array access (from variable 'msgids') results in a null pointer dereference # 397| /* linear search, bah */ # 398| for ( j = 0; j < i; j++ ) { # 399|-> if ( msgids[ j ] == msgid ) { # 400| msgids[ j ] = -1; # 401| active--; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:235:48: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 16)’ # 233| for ( p = b; p[0]; p++ ) { # 234| *epp = calloc( 1, sizeof( extra_t ) ); # 235|-> (*epp)->action = p[0]; # 236| epp = &(*epp)->next; # 237| nextra++; Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:235:48: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘extra’ # 233| for ( p = b; p[0]; p++ ) { # 234| *epp = calloc( 1, sizeof( extra_t ) ); # 235|-> (*epp)->action = p[0]; # 236| epp = &(*epp)->next; # 237| nextra++; Error: COMPILER_WARNING (CWE-563): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c: scope_hint: In function ‘get_search_filters’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:920:33: warning[-Wunused-but-set-variable]: variable ‘got_URL’ set but not used # 920 | int got_URL = 0; # | ^~~~~~~ # 918| while (( filter < MAXREQS ) && ( fgets( line, BUFSIZ, fp ))) { # 919| char *nl; # 920|-> int got_URL = 0; # 921| # 922| if (( nl = strchr( line, '\r' )) || ( nl = strchr( line, '\n' ))) Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:930:5: warning[deadcode.DeadStores]: Value stored to 'got_URL' is never read # 928| LDAPURLDesc *lud; # 929| # 930|-> got_URL = 1; # 931| bases[filter] = NULL; # 932| if ( ldap_url_parse( line, &lud ) != LDAP_URL_SUCCESS ) { Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c: scope_hint: In function ‘get_search_filters’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:955:53: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*filters’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:953:43: note: in expansion of macro ‘ArgDup’ # 953| filters[filter] = ArgDup( line ); # 954| if ( attrs ) { # 955|-> if ( filters[filter][0] == '+') { # 956| char *sep = strchr( filters[filter], ':' ); # 957| Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-tester.c:1042:11: warning[deadcode.DeadStores]: Although the value stored to 'pid' is used in the enclosing expression, the value is never actually read from 'pid' # 1040| wait4kids( maxkids ); # 1041| # 1042|-> switch ( pid = fork() ) { # 1043| case 0: /* child */ # 1044| #ifdef HAVE_EBCDIC Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:491:38: warning[core.NullDereference]: Dereference of null pointer # 489| ber_bvreplace( &sv->monitorbase, &dn ); # 490| sv->flags |= HAS_ENTRIES; # 491|-> sv->c_curr.entries = strtoul( bvals[0].bv_val, NULL, 0 ); # 492| } # 493| ber_memfree( bvals ); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:630:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read # 628| # 629| argv += optind; # 630|-> argc -= optind; # 631| servers = calloc( numservers, sizeof(server)); # 632| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c: scope_hint: In function ‘main’ openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:644:48: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘servers’ # 642| servers[i].sid = atoi(sids[i]); # 643| else # 644|-> servers[i].sid = i+1; # 645| } # 646| Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:648:32: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘servers’ # 646| # 647| for ( i = 0; i < numservers; i++ ) { # 648|-> servers[i].url = argv[i]; # 649| servers[i].times = calloc( numservers, sizeof(activity)); # 650| servers[i].csn_curr.vals = calloc( numservers, sizeof(struct berval)); Error: GCC_ANALYZER_WARNING (CWE-476): openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:668:41: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘msg1’ # 666| for (i=0; i<numservers; i++) { # 667| if ( !servers[i].ld || !(servers[i].flags & WAS_LATE )) { # 668|-> msg1[i] = 0; # 669| msg2[i] = 0; # 670| } Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:678:47: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 676| if ( servers[i].flags & WAS_DOWN ) # 677| servers[i].flags ^= WAS_DOWN; # 678|-> if (( servers[i].flags & HAS_MONITOR ) && !msg1[i] ) { # 679| char *attrs[3] = { at_monitorOpCompleted.bv_val }; # 680| if ( servers[i].flags & HAS_ENTRIES ) Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:698:44: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 696| } # 697| } # 698|-> if (( servers[i].flags & HAS_BASE ) && !msg2[i] ) { # 699| char *attrs[2] = { at_contextCSN.bv_val }; # 700| rc = ldap_search_ext( ld, cbase.bv_val, Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-2.6.7/tests/progs/slapd-watcher.c:764:9: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value # 762| ldap_msgfree( res ); # 763| } # 764|-> if ( msg2[i] ) { # 765| tv.tv_sec = 0; # 766| tv.tv_usec = 250000; Error: CPPCHECK_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c: scope_hint: In function ‘chomp’ openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c:99:9: warning[-Wstringop-truncation]: ‘strncpy’ specified bound depends on the length of the source argument # 99 | strncpy (t,s,strlen(s)+1); # | ^ openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c:99:22: note: length computed here # 99 | strncpy (t,s,strlen(s)+1); # | ^~~~~~~~~ # 97| { # 98| char* t = ber_memalloc(strlen(s)+1); # 99|-> strncpy (t,s,strlen(s)+1); # 100| # 101| if ( t[strlen(t)-1] == '\n' ) { Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c:227:59: warning[deadcode.DeadStores]: Although the value stored to 'dealer' is used in the enclosing expression, the value is never actually read from 'dealer' # 225| if ((word = strtok(start, " \t")) && (value = strtok(NULL, " \t"))) { # 226| while ( keyWord != NULL ) { # 227|-> if ((strncmp(keyWord,word,strlen(keyWord)) == 0) && (dealer = valid_word(word)) ) { # 228| # 229| #if defined(DEBUG) Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c:292:3: warning[deadcode.DeadStores]: Value stored to 'mem_len' is never read # 290| nLen = strlen (pPasswd); # 291| if ( nLen < 6) { # 292|-> mem_len = realloc_error_message(&szErrStr, mem_len, # 293| strlen(PASSWORD_TOO_SHORT_SZ) + # 294| strlen(pEntry->e_name.bv_val) + 1); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c:374:3: warning[deadcode.DeadStores]: Value stored to 'mem_len' is never read # 372| (nQuality < minQuality) # 373| ) { # 374|-> mem_len = realloc_error_message(&szErrStr, mem_len, # 375| strlen(PASSWORD_QUALITY_SZ) + # 376| strlen(pEntry->e_name.bv_val) + 2); Error: CLANG_WARNING: openldap-2.6.7-build/openldap-2.6.7/openldap-ppolicy-check-password-1.1/check_password.c:419:5: warning[deadcode.DeadStores]: Value stored to 'mem_len' is never read # 417| r = (char *) FascistCheck (pPasswd, CRACKLIB_DICTPATH); # 418| if ( r != NULL ) { # 419|-> mem_len = realloc_error_message(&szErrStr, mem_len, # 420| strlen(BAD_PASSWORD_SZ) + # 421| strlen(pEntry->e_name.bv_val) +