autofs-5.1.9-7.fc41
List of Defects
Error: CPPCHECK_WARNING: [#def1]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def2]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:362:7: warning[core.UndefinedBinaryOperatorResult]: The left operand of '&' is a garbage value
# 360|
# 361| if (ret != -1 && (fn) (ap, base, pst, 0, arg)) {
# 362|-> if (S_ISDIR(st.st_mode)) {
# 363| struct dirent **de;
# 364| int n;
Error: CLANG_WARNING: [#def3]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:953:2: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value
# 951| return -1;
# 952|
# 953|-> debug(ap->logopt, "type = %d", pkt.hdr.type);
# 954|
# 955| switch (pkt.hdr.type) {
Error: CLANG_WARNING: [#def4]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:1044:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 1042| char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
# 1043| fprintf(stderr, "setsid: %s", estr);
# 1044|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 1045| close(start_pipefd[1]);
# 1046| exit(*pst_stat);
Error: CLANG_WARNING: [#def5]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:1054:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 1052| char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
# 1053| fprintf(stderr, "cannot open /dev/null: %s", estr);
# 1054|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 1055| close(start_pipefd[1]);
# 1056| exit(*pst_stat);
Error: CLANG_WARNING: [#def6]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:1065:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 1063| fprintf(stderr,
# 1064| "redirecting file descriptors failed: %s", estr);
# 1065|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 1066| close(start_pipefd[1]);
# 1067| exit(*pst_stat);
Error: CLANG_WARNING: [#def7]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:1243:2: warning[deadcode.DeadStores]: Value stored to 'status' is never read
# 1241| master->readall = 1;
# 1242|
# 1243|-> status = master_read_master(master, age);
# 1244|
# 1245| master->readall = 0;
Error: CLANG_WARNING: [#def8]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2092:2: warning[deadcode.DeadStores]: Value stored to 'count' is never read
# 2090| #ifdef WITH_LIBTIRPC
# 2091| printf("WITH_LIBTIRPC ");
# 2092|-> count = count + 14;
# 2093| #endif
# 2094|
Error: CLANG_WARNING: [#def9]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2152:8: warning[core.NullDereference]: Dereference of null pointer
# 2150|
# 2151| if (i == next_to_last) {
# 2152|-> if (*argv[i])
# 2153| argv[j++] = argv[i];
# 2154| break;
Error: CLANG_WARNING: [#def10]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2581:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2579| program);
# 2580| if (start_pipefd[1] != -1) {
# 2581|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2582| close(start_pipefd[1]);
# 2583| }
Error: CLANG_WARNING: [#def11]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2593:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2591| program);
# 2592| if (start_pipefd[1] != -1) {
# 2593|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2594| close(start_pipefd[1]);
# 2595| }
Error: CLANG_WARNING: [#def12]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2606:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2604| program);
# 2605| if (start_pipefd[1] != -1) {
# 2606|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2607| close(start_pipefd[1]);
# 2608| }
Error: CLANG_WARNING: [#def13]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2626:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2624| master_kill(master_list);
# 2625| if (start_pipefd[1] != -1) {
# 2626|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2627| close(start_pipefd[1]);
# 2628| }
Error: CLANG_WARNING: [#def14]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2640:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2638| master_kill(master_list);
# 2639| if (start_pipefd[1] != -1) {
# 2640|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2641| close(start_pipefd[1]);
# 2642| }
Error: CLANG_WARNING: [#def15]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2654:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2652| master_kill(master_list);
# 2653| if (start_pipefd[1] != -1) {
# 2654|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2655| close(start_pipefd[1]);
# 2656| }
Error: CLANG_WARNING: [#def16]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2666:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2664| master_kill(master_list);
# 2665| if (start_pipefd[1] != -1) {
# 2666|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2667| close(start_pipefd[1]);
# 2668| }
Error: CLANG_WARNING: [#def17]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2678:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2676| master_kill(master_list);
# 2677| if (start_pipefd[1] != -1) {
# 2678|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2679| close(start_pipefd[1]);
# 2680| }
Error: CLANG_WARNING: [#def18]
autofs-5.1.9-build/autofs-5.1.9/daemon/automount.c:2736:4: warning[deadcode.DeadStores]: Value stored to 'res' is never read
# 2734| if (start_pipefd[1] != -1) {
# 2735| st_stat = 0;
# 2736|-> res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
# 2737| close(start_pipefd[1]);
# 2738| }
Error: CPPCHECK_WARNING: [#def19]
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c: scope_hint: In function ‘do_mount_autofs_direct’
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c:304:32: warning[-Wanalyzer-malloc-leak]: leak of ‘mp’
# 302| ap->flags &= ~MOUNT_FLAG_REMOUNT;
# 303| if (ret == 1)
# 304|-> return 0;
# 305| if (ret == 0)
# 306| return -1;
Error: CLANG_WARNING: [#def21]
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c:417:19: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
# 415| me->ino = st.st_ino;
# 416|
# 417|-> if (ap->mode && (err = chmod(me->key, ap->mode)))
# 418| warn(ap->logopt, "failed to change mode of %s", me->key);
# 419|
Error: CPPCHECK_WARNING: [#def22]
autofs-5.1.9-build/autofs-5.1.9/daemon/flag.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def23]
autofs-5.1.9-build/autofs-5.1.9/daemon/indirect.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def24]
autofs-5.1.9-build/autofs-5.1.9/daemon/indirect.c:129:19: warning[deadcode.DeadStores]: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
# 127| ap->dev = st.st_dev; /* Device number for mount point checks */
# 128|
# 129|-> if (ap->mode && (err = chmod(ap->path, ap->mode)))
# 130| warn(ap->logopt, "failed to change mode of %s", ap->path);
# 131|
Error: CPPCHECK_WARNING: [#def25]
autofs-5.1.9-build/autofs-5.1.9/daemon/lookup.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def26]
autofs-5.1.9-build/autofs-5.1.9/daemon/lookup.c:675:2: warning[deadcode.DeadStores]: Value stored to 'l_prefix' is never read
# 673| k_start = (char *) key;
# 674| k_len = strlen(key);
# 675|-> l_prefix = 0;
# 676|
# 677| if (prefix) {
Error: CLANG_WARNING: [#def27]
autofs-5.1.9-build/autofs-5.1.9/daemon/lookup.c:1197:4: warning[deadcode.DeadStores]: Value stored to 'status' is never read
# 1195| */
# 1196| if (entry->age > map->age) {
# 1197|-> status = NSS_STATUS_UNAVAIL;
# 1198| map = map->next;
# 1199| continue;
Error: CLANG_WARNING: [#def28]
autofs-5.1.9-build/autofs-5.1.9/daemon/lookup.c:1219:6: warning[deadcode.DeadStores]: Value stored to 'status' is never read
# 1217| if (!tmp) {
# 1218| map = map->next;
# 1219|-> status = NSS_STATUS_TRYAGAIN;
# 1220| continue;
# 1221| }
Error: CPPCHECK_WARNING: [#def29]
autofs-5.1.9-build/autofs-5.1.9/daemon/master.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def30]
autofs-5.1.9-build/autofs-5.1.9/daemon/master.c:1582:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1580| return;
# 1581|
# 1582|-> if (!strcmp(source->argv[i], "--"))
# 1583| continue;
# 1584|
Error: CPPCHECK_WARNING: [#def31]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-457): [#def32]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c: scope_hint: In function ‘master_parse’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:578:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:563:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:1200:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:563:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:1200:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:563:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:1200:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
# 576| # if defined __GNUC__ && 1 < __GNUC__
# 577| # define YYCOPY(Dst, Src, Count) \
# 578|-> __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# 579| # else
# 580| # define YYCOPY(Dst, Src, Count) \
Error: GCC_ANALYZER_WARNING (CWE-457): [#def33]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_parse.tab.c:1327:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
# 1325| unconditionally makes the parser a bit smaller, and it avoids a
# 1326| GCC warning that YYVAL may be used uninitialized. */
# 1327|-> yyval = yyvsp[1-yylen];
# 1328|
# 1329|
Error: CPPCHECK_WARNING: [#def34]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: COMPILER_WARNING (CWE-1164): [#def35]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:2925:16: warning[-Wunused-function]: ‘input’ defined but not used
# 2925 | #else
# | ^
# 2923| #ifdef __cplusplus
# 2924| static int yyinput (void)
# 2925|-> #else
# 2926| static int input (void)
# 2927| #endif
Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c: scope_hint: In function ‘master__create_buffer’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3076:12: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3062:21: note: in expansion of macro ‘yy_create_buffer’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3066:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c: scope_hint: In function ‘master__create_buffer’
# 3074| * we need to put in 2 end-of-buffer characters.
# 3075| */
# 3076|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
# 3077| if ( ! b->yy_ch_buf )
# 3078| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: CPPCHECK_WARNING (CWE-476): [#def37]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3116: warning[nullPointer]: Possible null pointer dereference: b
# 3114|
# 3115| yy_flush_buffer( b );
# 3116|->
# 3117| b->yy_input_file = file;
# 3118| b->yy_fill_buffer = 1;
Error: CPPCHECK_WARNING (CWE-476): [#def38]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3117: warning[nullPointer]: Possible null pointer dereference: b
# 3115| yy_flush_buffer( b );
# 3116|
# 3117|-> b->yy_input_file = file;
# 3118| b->yy_fill_buffer = 1;
# 3119|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c: scope_hint: In function ‘master__scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3330:25: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(n)’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3314:17: note: in expansion of macro ‘yy_scan_bytes’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3323:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c: scope_hint: In function ‘master__scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3332:6: note: in expansion of macro ‘yy_scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/daemon/master_tok.c:3264:17: note: in expansion of macro ‘yy_scan_buffer’
# 3328| for ( i = 0; i < _yybytes_len; ++i )
# 3329| buf[i] = yybytes[i];
# 3330|->
# 3331| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 3332|
Error: CPPCHECK_WARNING: [#def40]
autofs-5.1.9-build/autofs-5.1.9/daemon/module.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def41]
autofs-5.1.9-build/autofs-5.1.9/daemon/mount.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def42]
autofs-5.1.9-build/autofs-5.1.9/daemon/spawn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def43]
autofs-5.1.9-build/autofs-5.1.9/daemon/state.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def44]
autofs-5.1.9-build/autofs-5.1.9/daemon/state.c:436:3: warning[deadcode.DeadStores]: Value stored to 'status' is never read
# 434| ops->timeout(ap->logopt, ap->ioctlfd, timeout);
# 435| lookup_prune_cache(ap, now);
# 436|-> status = lookup_ghost(ap);
# 437| } else {
# 438| struct mapent *me;
Error: COMPILER_WARNING: [#def45]
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c: scope_hint: In function ‘getsrvinfo’
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c:218:20: warning: RES_AAONLY is deprecated
# 218 | _res.options |= RES_AAONLY;
# | ^~~~~~~~~~~~~~~~
# 216| }
# 217|
# 218|-> _res.options |= RES_AAONLY;
# 219| len = res_querydomain(srvname, domainname, C_IN, T_SRV, msg, NS_MAXMSG);
# 220| if (len == -1) {
Error: CLANG_WARNING: [#def46]
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c:283:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'results'
# 281| new = calloc(1, sizeof(*new));
# 282| if (new == NULL) {
# 283|-> status = ESI_MEMORY;
# 284| goto out;
# 285| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c:306:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c:41: included_from: Included from here.
/usr/include/netdb.h:27: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c:36: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c: scope_hint: In function ‘getsrvinfo’
# 304| free(exp_dn);
# 305| free(msg);
# 306|-> return status;
# 307|
# 308| out_free:
Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c:306:16: warning[-Wanalyzer-malloc-leak]: leak of ‘results’
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-getsrvinfo.c: scope_hint: In function ‘getsrvinfo’
# 304| free(exp_dn);
# 305| free(msg);
# 306|-> return status;
# 307|
# 308| out_free:
Error: CPPCHECK_WARNING: [#def49]
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-map-nfs4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def50]
autofs-5.1.9-build/autofs-5.1.9/fedfs/fedfs-map-nfs4.c:105:9: warning[core.NullDereference]: Access to field 'si_port' results in a dereference of a null pointer (loaded from variable 'si')
# 103| * ports from one another.
# 104| */
# 105|-> port = si->si_port;
# 106| for (cur = si; cur != NULL; cur = cur->si_next)
# 107| if (cur->si_port != port) {
Error: CPPCHECK_WARNING: [#def51]
autofs-5.1.9-build/autofs-5.1.9/fedfs/mount.fedfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def52]
autofs-5.1.9-build/autofs-5.1.9/fedfs/mount.fedfs.c:318:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 316| result = EX_FAIL;
# 317|
# 318|-> global_name = strdup(source);
# 319| if (global_name == NULL) {
# 320| fprintf(stderr, _("%s: Unable to parse globally useful name\n"),
Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c:39: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c: scope_hint: In function ‘mount_autofs_offset’
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:588:33: warning[-Wanalyzer-malloc-leak]: leak of ‘mp’
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c:653:32: note: in expansion of macro ‘MOUNT_OFFSET_OK’
autofs-5.1.9-build/autofs-5.1.9/daemon/direct.c:653:32: note: in expansion of macro ‘MOUNT_OFFSET_OK’
# 586| /* Standard functions used by daemon or modules */
# 587|
# 588|-> #define MOUNT_OFFSET_OK 0
# 589| #define MOUNT_OFFSET_FAIL -1
# 590| #define MOUNT_OFFSET_IGNORE -2
Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
autofs-5.1.9-build/autofs-5.1.9/include/hash.h:36:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘s’
# 34| char *s = (char *) key;
# 35|
# 36|-> for (hashval = 0; *s != '\0';) {
# 37| hashval += (unsigned char) *s++;
# 38| hashval += (hashval << 10);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:25: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/lib/cache.c:25: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/include/hash.h: scope_hint: In function ‘hash’
autofs-5.1.9-build/autofs-5.1.9/include/hash.h:36:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
# 34| char *s = (char *) key;
# 35|
# 36|-> for (hashval = 0; *s != '\0';) {
# 37| hashval += (unsigned char) *s++;
# 38| hashval += (hashval << 10);
Error: CPPCHECK_WARNING: [#def56]
autofs-5.1.9-build/autofs-5.1.9/lib/alarm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def57]
autofs-5.1.9-build/autofs-5.1.9/lib/alarm.c:93:19: warning[unix.Malloc]: Potential leak of memory pointed to by 'new'
# 91| */
# 92| if (empty || new->time < next_alarm) {
# 93|-> status = pthread_cond_signal(&cond);
# 94| if (status)
# 95| fatal(status);
Error: CLANG_WARNING: [#def58]
autofs-5.1.9-build/autofs-5.1.9/lib/alarm.c:231:7: warning[unix.Malloc]: Use of memory after it is freed
# 229| now = monotonic_time(NULL);
# 230|
# 231|-> if (first->time > now) {
# 232| struct timespec nsecs;
# 233|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def59]
autofs-5.1.9-build/autofs-5.1.9/lib/alarm.c: scope_hint: In function ‘alarm_handler’
autofs-5.1.9-build/autofs-5.1.9/lib/alarm.c:256:25: warning[-Wanalyzer-double-free]: double-‘free’ of ‘alarms.next + -24’
autofs-5.1.9-build/autofs-5.1.9/lib/alarm.c:214:9: note: in expansion of macro ‘alarm_lock’
# 254| alarm_lock();
# 255| }
# 256|-> free(first);
# 257| }
# 258| }
Error: CPPCHECK_WARNING: [#def60]
autofs-5.1.9-build/autofs-5.1.9/lib/args.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def61]
autofs-5.1.9-build/autofs-5.1.9/lib/args.c:187:7: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 185|
# 186| for (i = 0; i < argc; i++) {
# 187|-> if (vector[i])
# 188| free(vector[i]);
# 189| }
Error: CPPCHECK_WARNING: [#def62]
autofs-5.1.9-build/autofs-5.1.9/lib/cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def63]
autofs-5.1.9-build/autofs-5.1.9/lib/cat_path.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def64]
autofs-5.1.9-build/autofs-5.1.9/lib/defaults.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-476): [#def65]
autofs-5.1.9-build/autofs-5.1.9/lib/defaults.c:665: warning[nullPointer]: Possible null pointer dereference: last
# 663| next = last->next;
# 664| }
# 665|-> last->next = co;
# 666| }
# 667|
Error: CLANG_WARNING: [#def66]
autofs-5.1.9-build/autofs-5.1.9/lib/defaults.c:665:14: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'last')
# 663| next = last->next;
# 664| }
# 665|-> last->next = co;
# 666| }
# 667|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
autofs-5.1.9-build/autofs-5.1.9/lib/defaults.c: scope_hint: In function ‘conf_add’
autofs-5.1.9-build/autofs-5.1.9/lib/defaults.c:665:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘last’
autofs-5.1.9-build/autofs-5.1.9/lib/defaults.c:19: included_from: Included from here.
# 663| next = last->next;
# 664| }
# 665|-> last->next = co;
# 666| }
# 667|
Error: CPPCHECK_WARNING (CWE-457): [#def68]
autofs-5.1.9-build/autofs-5.1.9/lib/dev-ioctl-lib.c:671: warning[uninitvar]: Uninitialized variable: ret
# 669| }
# 670|
# 671|-> if (!ret || save_errno == EAGAIN) {
# 672| may_umount = 0;
# 673| if (!ctl.ops->askumount(logopt, ioctlfd, &may_umount)) {
Error: CPPCHECK_WARNING: [#def69]
autofs-5.1.9-build/autofs-5.1.9/lib/log.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def70]
autofs-5.1.9-build/autofs-5.1.9/lib/log.c:381:2: warning[core.CallAndMessage]: 6th function call argument is an uninitialized value
# 379| fclose(statfile);
# 380|
# 381|-> info(ap->logopt,
# 382| "pidinfo %s: pid:%d comm:%s tgid:%d uid:%d euid:%d gid:%d egid:%d",
# 383| label, pid, comm, tgid, uid, euid, gid, egid);
Error: CLANG_WARNING: [#def71]
autofs-5.1.9-build/autofs-5.1.9/lib/log.c:381:2: warning[core.CallAndMessage]: 7th function call argument is an uninitialized value
# 379| fclose(statfile);
# 380|
# 381|-> info(ap->logopt,
# 382| "pidinfo %s: pid:%d comm:%s tgid:%d uid:%d euid:%d gid:%d egid:%d",
# 383| label, pid, comm, tgid, uid, euid, gid, egid);
Error: CLANG_WARNING: [#def72]
autofs-5.1.9-build/autofs-5.1.9/lib/log.c:381:2: warning[core.CallAndMessage]: 9th function call argument is an uninitialized value
# 379| fclose(statfile);
# 380|
# 381|-> info(ap->logopt,
# 382| "pidinfo %s: pid:%d comm:%s tgid:%d uid:%d euid:%d gid:%d egid:%d",
# 383| label, pid, comm, tgid, uid, euid, gid, egid);
Error: CPPCHECK_WARNING (CWE-457): [#def73]
autofs-5.1.9-build/autofs-5.1.9/lib/log.c:385: warning[uninitvar]: Uninitialized variable: ppid
# 383| label, pid, comm, tgid, uid, euid, gid, egid);
# 384|
# 385|-> return ppid;
# 386| }
# 387|
Error: CLANG_WARNING: [#def74]
autofs-5.1.9-build/autofs-5.1.9/lib/log.c:385:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller
# 383| label, pid, comm, tgid, uid, euid, gid, egid);
# 384|
# 385|-> return ppid;
# 386| }
# 387|
Error: CPPCHECK_WARNING: [#def75]
autofs-5.1.9-build/autofs-5.1.9/lib/macros.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def76]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def77]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c:113:2: warning[deadcode.DeadStores]: Value stored to 'p' is never read
# 111| return 0;
# 112|
# 113|-> p = q = r = 0;
# 114|
# 115| tmp = strtok_r(my_utsname.release, ".", &save);
Error: CLANG_WARNING: [#def78]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c:113:6: warning[deadcode.DeadStores]: Although the value stored to 'q' is used in the enclosing expression, the value is never actually read from 'q'
# 111| return 0;
# 112|
# 113|-> p = q = r = 0;
# 114|
# 115| tmp = strtok_r(my_utsname.release, ".", &save);
Error: CLANG_WARNING: [#def79]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c:113:10: warning[deadcode.DeadStores]: Although the value stored to 'r' is used in the enclosing expression, the value is never actually read from 'r'
# 111| return 0;
# 112|
# 113|-> p = q = r = 0;
# 114|
# 115| tmp = strtok_r(my_utsname.release, ".", &save);
Error: CLANG_WARNING: [#def80]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c:1128:2: warning[unix.Malloc]: Use of memory after it is freed
# 1126| mnts_hash_mutex_unlock();
# 1127| fail:
# 1128|-> return this;
# 1129| }
# 1130|
Error: CPPCHECK_WARNING (CWE-457): [#def81]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c:1386: warning[uninitvar]: Uninitialized variable: eq
# 1384| }
# 1385|
# 1386|-> if (!eq)
# 1387| return p;
# 1388| else {
Error: CLANG_WARNING: [#def82]
autofs-5.1.9-build/autofs-5.1.9/lib/mounts.c:1956:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1954| ret = tree_mapent_rmdir_path_offset(ap, oe);
# 1955| if (ret == -1 && !stat(oe->key, &st)) {
# 1956|-> ret = tree_mapent_mount_offset(oe, ctxt);
# 1957| /* But we did origianlly create this */
# 1958| oe->flags |= MOUNT_FLAG_DIR_CREATED;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c: scope_hint: In function ‘nss_parse’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:429:21: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:140:40: note: in definition of macro ‘YY_CAST’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:415:25: note: in expansion of macro ‘YYMALLOC’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1007:20: note: in expansion of macro ‘YYSTACK_ALLOC’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:902:1: note: in expansion of macro ‘yyparse’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1056:16: note: in expansion of macro ‘yylex’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1077:17: note: in expansion of macro ‘YYTRANSLATE’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1056:16: note: in expansion of macro ‘yylex’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:140:40: note: in definition of macro ‘YY_CAST’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:415:25: note: in expansion of macro ‘YYMALLOC’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1007:20: note: in expansion of macro ‘YYSTACK_ALLOC’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:474:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1010:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:140:40: note: in definition of macro ‘YY_CAST’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:415:25: note: in expansion of macro ‘YYMALLOC’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1007:20: note: in expansion of macro ‘YYSTACK_ALLOC’
# 427| # endif
# 428| # ifndef YYMALLOC
# 429|-> # define YYMALLOC malloc
# 430| # if ! defined malloc && ! defined EXIT_SUCCESS
# 431| void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
Error: GCC_ANALYZER_WARNING (CWE-457): [#def84]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:489:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:474:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1010:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:902:1: note: in expansion of macro ‘yyparse’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:474:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1010:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:474:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_parse.tab.c:1010:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
# 487| # if defined __GNUC__ && 1 < __GNUC__
# 488| # define YYCOPY(Dst, Src, Count) \
# 489|-> __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# 490| # else
# 491| # define YYCOPY(Dst, Src, Count) \
Error: CPPCHECK_WARNING: [#def85]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c: scope_hint: In function ‘yy_get_next_buffer’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1402:18: warning[-Wanalyzer-malloc-leak]: leak of ‘*b.yy_ch_buf’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1388:45: note: in expansion of macro ‘YY_CURRENT_BUFFER_LVALUE’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1404:41: note: in expansion of macro ‘yyrealloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:2145:7: note: in expansion of macro ‘yyrealloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1404:41: note: in expansion of macro ‘yyrealloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1388:45: note: in expansion of macro ‘YY_CURRENT_BUFFER_LVALUE’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1404:41: note: in expansion of macro ‘yyrealloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:2145:7: note: in expansion of macro ‘yyrealloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1404:41: note: in expansion of macro ‘yyrealloc’
# 1400| else
# 1401| b->yy_buf_size *= 2;
# 1402|->
# 1403| b->yy_ch_buf = (char *)
# 1404| /* Include room in for 2 EOB chars. */
Error: COMPILER_WARNING (CWE-1164): [#def87]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1537:16: warning[-Wunused-function]: ‘input’ defined but not used
# 1537 | #else
# | ^
# 1535| #ifdef __cplusplus
# 1536| static int yyinput (void)
# 1537|-> #else
# 1538| static int input (void)
# 1539| #endif
Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c: scope_hint: In function ‘nss__create_buffer’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1690:12: warning[-Wanalyzer-malloc-leak]: leak of ‘nss_alloc(64)’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1676:21: note: in expansion of macro ‘yy_create_buffer’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1680:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:2140:7: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1680:24: note: in expansion of macro ‘yyalloc’
# 1688| * we need to put in 2 end-of-buffer characters.
# 1689| */
# 1690|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
# 1691| if ( ! b->yy_ch_buf )
# 1692| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: CPPCHECK_WARNING (CWE-476): [#def89]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1730: warning[nullPointer]: Possible null pointer dereference: b
# 1728|
# 1729| yy_flush_buffer( b );
# 1730|->
# 1731| b->yy_input_file = file;
# 1732| b->yy_fill_buffer = 1;
Error: CPPCHECK_WARNING (CWE-476): [#def90]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1731: warning[nullPointer]: Possible null pointer dereference: b
# 1729| yy_flush_buffer( b );
# 1730|
# 1731|-> b->yy_input_file = file;
# 1732| b->yy_fill_buffer = 1;
# 1733|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c: scope_hint: In function ‘nss__scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1944:25: warning[-Wanalyzer-malloc-leak]: leak of ‘nss_alloc(n)’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1928:17: note: in expansion of macro ‘yy_scan_bytes’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1937:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:2140:7: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1937:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1946:6: note: in expansion of macro ‘yy_scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/lib/nss_tok.c:1878:17: note: in expansion of macro ‘yy_scan_buffer’
# 1942| for ( i = 0; i < _yybytes_len; ++i )
# 1943| buf[i] = yybytes[i];
# 1944|->
# 1945| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1946|
Error: CPPCHECK_WARNING: [#def92]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def93]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:180:19: warning[deadcode.DeadStores]: Value stored to 'next' during its initialization is never read
# 178| {
# 179| struct selector *s = selector;
# 180|-> struct selector *next = s;
# 181|
# 182| while (s) {
Error: GCC_ANALYZER_WARNING (CWE-688): [#def94]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c: scope_hint: In function ‘get_proximity’
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:285:31: warning[-Wanalyzer-null-argument]: use of NULL ‘hst_addr’ where non-null expected
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:19: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 2 of ‘memcmp’ must be non-null
# 283| break;
# 284| if_addr = (struct sockaddr_in *) this->ifa_addr;
# 285|-> ret = memcmp(&if_addr->sin_addr, hst_addr, addr_len);
# 286| if (!ret) {
# 287| freeifaddrs(ifa);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def95]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:305:31: warning[-Wanalyzer-null-argument]: use of NULL ‘hst6_addr’ where non-null expected
/usr/include/string.h:64:12: note: argument 2 of ‘memcmp’ must be non-null
# 303| break;
# 304| if6_addr = (struct sockaddr_in6 *) this->ifa_addr;
# 305|-> ret = memcmp(&if6_addr->sin6_addr, hst6_addr, addr_len);
# 306| if (!ret) {
# 307| freeifaddrs(ifa);
Error: CLANG_WARNING: [#def96]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:909:49: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
# 907|
# 908| /* Remove trailing / but watch out for a quoted / alone */
# 909|-> if (strlen(cp) > 1 && origlen > 1 && *(cp - 1) == '/')
# 910| *(cp - 1) = '\0';
# 911|
Error: CPPCHECK_WARNING (CWE-457): [#def97]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:974: error[uninitvar]: Uninitialized variable: str
# 972| return strdup(opt1);
# 973|
# 974|-> if (strlen(str) > MAX_OPTIONS_LEN)
# 975| return NULL;
# 976| memset(result, 0, sizeof(result));
Error: GCC_ANALYZER_WARNING (CWE-457): [#def98]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c: scope_hint: In function ‘merge_options’
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:974:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘str[0]’
/usr/include/string.h:407:15: note: argument 1 of ‘strlen’ must be a pointer to a null-terminated string
# 972| return strdup(opt1);
# 973|
# 974|-> if (strlen(str) > MAX_OPTIONS_LEN)
# 975| return NULL;
# 976| memset(result, 0, sizeof(result));
Error: CLANG_WARNING: [#def99]
autofs-5.1.9-build/autofs-5.1.9/lib/parse_subs.c:1298:2: warning[deadcode.DeadStores]: Value stored to 'start' is never read
# 1296| int argc;
# 1297|
# 1298|-> start = str;
# 1299|
# 1300| args = malloc(sizeof(char *));
Error: CPPCHECK_WARNING: [#def100]
autofs-5.1.9-build/autofs-5.1.9/lib/rpc_subs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def101]
autofs-5.1.9-build/autofs-5.1.9/lib/rpc_subs.c:557:8: warning[core.NullDereference]: Access to field 'cl_ops' results in a dereference of a null pointer (loaded from variable 'client')
# 555| paddr = info->addr;
# 556| else {
# 557|-> if (!clnt_control(client, CLGET_SERVER_ADDR, (char *) &addr))
# 558| return RPC_UNKNOWNADDR;
# 559| paddr = &addr;
Error: CLANG_WARNING: [#def102]
autofs-5.1.9-build/autofs-5.1.9/lib/rpc_subs.c:939:9: warning[core.NullDereference]: Access to field 'cl_ops' results in a dereference of a null pointer (loaded from variable 'client')
# 937| int fd;
# 938|
# 939|-> if (!clnt_control(client, CLGET_FD, (char *) &fd))
# 940| fd = -1;
# 941|
Error: CLANG_WARNING: [#def103]
autofs-5.1.9-build/autofs-5.1.9/lib/rpc_subs.c:949:3: warning[core.NullDereference]: Access to field 'cl_ops' results in a dereference of a null pointer (loaded from variable 'client')
# 947| }
# 948| }
# 949|-> clnt_destroy(client);
# 950| }
# 951|
Error: CLANG_WARNING: [#def104]
autofs-5.1.9-build/autofs-5.1.9/lib/rpc_subs.c:1037:2: warning[deadcode.DeadStores]: Value stored to 'status' is never read
# 1035| info.client = NULL;
# 1036|
# 1037|-> status = RPC_PING_FAIL;
# 1038|
# 1039|
Error: CLANG_WARNING: [#def105]
autofs-5.1.9-build/autofs-5.1.9/lib/rpc_subs.c:1185:2: warning[core.NullDereference]: Access to field 'cl_ops' results in a dereference of a null pointer (loaded from variable 'client')
# 1183| return 0;
# 1184|
# 1185|-> clnt_control(client, CLSET_TIMEOUT, (char *) &info->timeout);
# 1186| clnt_control(client, CLSET_RETRY_TIMEOUT, (char *) &info->timeout);
# 1187|
Error: CPPCHECK_WARNING: [#def106]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-457): [#def107]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c: scope_hint: In function ‘amd_parse’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:544:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:529:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:1089:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:529:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:1089:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:529:9: note: in expansion of macro ‘YYCOPY’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:1089:9: note: in expansion of macro ‘YYSTACK_RELOCATE’
# 542| # if defined __GNUC__ && 1 < __GNUC__
# 543| # define YYCOPY(Dst, Src, Count) \
# 544|-> __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# 545| # else
# 546| # define YYCOPY(Dst, Src, Count) \
Error: GCC_ANALYZER_WARNING (CWE-457): [#def108]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_parse.tab.c:1216:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
# 1214| unconditionally makes the parser a bit smaller, and it avoids a
# 1215| GCC warning that YYVAL may be used uninitialized. */
# 1216|-> yyval = yyvsp[1-yylen];
# 1217|
# 1218|
Error: CPPCHECK_WARNING: [#def109]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: COMPILER_WARNING (CWE-1164): [#def110]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:2841:16: warning[-Wunused-function]: ‘input’ defined but not used
# 2841 | #else
# | ^
# 2839| #ifdef __cplusplus
# 2840| static int yyinput (void)
# 2841|-> #else
# 2842| static int input (void)
# 2843| #endif
Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c: scope_hint: In function ‘amd__create_buffer’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:2992:12: warning[-Wanalyzer-malloc-leak]: leak of ‘amd_alloc(64)’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:2978:21: note: in expansion of macro ‘yy_create_buffer’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:2982:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3450:7: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:2982:24: note: in expansion of macro ‘yyalloc’
# 2990| * we need to put in 2 end-of-buffer characters.
# 2991| */
# 2992|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
# 2993| if ( ! b->yy_ch_buf )
# 2994| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: CPPCHECK_WARNING (CWE-476): [#def112]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3032: warning[nullPointer]: Possible null pointer dereference: b
# 3030|
# 3031| yy_flush_buffer( b );
# 3032|->
# 3033| b->yy_input_file = file;
# 3034| b->yy_fill_buffer = 1;
Error: CPPCHECK_WARNING (CWE-476): [#def113]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3033: warning[nullPointer]: Possible null pointer dereference: b
# 3031| yy_flush_buffer( b );
# 3032|
# 3033|-> b->yy_input_file = file;
# 3034| b->yy_fill_buffer = 1;
# 3035|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c: scope_hint: In function ‘amd__scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3246:25: warning[-Wanalyzer-malloc-leak]: leak of ‘amd_alloc(n)’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3230:17: note: in expansion of macro ‘yy_scan_bytes’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3239:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3450:7: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3239:24: note: in expansion of macro ‘yyalloc’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3248:6: note: in expansion of macro ‘yy_scan_buffer’
autofs-5.1.9-build/autofs-5.1.9/modules/amd_tok.c:3180:17: note: in expansion of macro ‘yy_scan_buffer’
# 3244| for ( i = 0; i < _yybytes_len; ++i )
# 3245| buf[i] = yybytes[i];
# 3246|->
# 3247| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 3248|
Error: CPPCHECK_WARNING: [#def115]
autofs-5.1.9-build/autofs-5.1.9/modules/base64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: COMPILER_WARNING (CWE-681): [#def116]
autofs-5.1.9-build/autofs-5.1.9/modules/base64.c: scope_hint: In function ‘base64_encode’
autofs-5.1.9-build/autofs-5.1.9/modules/base64.c:48:39: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘_base64_encode_triple’ differ in signedness
# 48 | _base64_encode_triple(source, target);
# | ^~~~~~
# | |
# | char *
autofs-5.1.9-build/autofs-5.1.9/modules/base64.c:15:49: note: expected ‘unsigned char *’ but argument is of type ‘char *’
# 15 | static void _base64_encode_triple(unsigned char triple[3], char result[4])
# | ~~~~~~~~~~~~~~^~~~~~~~~
# 46| /* encode all full triples */
# 47| while (sourcelen >= 3) {
# 48|-> _base64_encode_triple(source, target);
# 49| sourcelen -= 3;
# 50| source += 3;
Error: CPPCHECK_WARNING: [#def117]
autofs-5.1.9-build/autofs-5.1.9/modules/dclist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def118]
autofs-5.1.9-build/autofs-5.1.9/modules/dclist.c:474:24: warning[core.NullDereference]: Array access (via field 'lud_dn') results in a null pointer dereference
# 472| int i;
# 473|
# 474|-> if (!lud->lud_dn && !lud->lud_dn[0] &&
# 475| (!lud->lud_host || !lud->lud_host[0])) {
# 476| *ludp = lud->lud_next;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
autofs-5.1.9-build/autofs-5.1.9/modules/dclist.c: scope_hint: In function ‘get_dc_list’
autofs-5.1.9-build/autofs-5.1.9/modules/dclist.c:474:49: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 472| int i;
# 473|
# 474|-> if (!lud->lud_dn && !lud->lud_dn[0] &&
# 475| (!lud->lud_host || !lud->lud_host[0])) {
# 476| *ludp = lud->lud_next;
Error: CLANG_WARNING: [#def120]
autofs-5.1.9-build/autofs-5.1.9/modules/dclist.c:581:3: warning[unix.Malloc]: Attempt to free released memory
# 579| out_error:
# 580| if (list)
# 581|-> free(list);
# 582| if (domain)
# 583| ber_memfree(domain);
Error: CPPCHECK_WARNING: [#def121]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_dir.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def122]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_file.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c: scope_hint: In function ‘update_hosts_mounts’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c:323:1: warning[-Wanalyzer-malloc-leak]: leak of ‘head’
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:33: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c:24: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c:341:17: note: in expansion of macro ‘debug’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c:281:22: note: in expansion of macro ‘IS_MM’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c:284:17: note: in expansion of macro ‘debug’
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:17: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c: scope_hint: In function ‘update_hosts_mounts’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c:309:17: note: in expansion of macro ‘debug’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_hosts.c: scope_hint: In function ‘update_hosts_mounts’
# 321| }
# 322| pthread_cleanup_pop(1);
# 323|-> }
# 324|
# 325| int lookup_read_map(struct autofs_point *ap, struct map_source *map, time_t age, void *context)
Error: CPPCHECK_WARNING: [#def124]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-688): [#def125]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c: scope_hint: In function ‘autofs_ldap_debug.part.0’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:166:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘msg’ where non-null expected
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:23: included_from: Included from here.
/usr/include/string.h:293:15: note: argument 1 of ‘strcspn’ must be non-null
# 164| if (buf) {
# 165| msg = strdup(buf);
# 166|-> msg[strcspn(msg, "\n")] = '\0';
# 167| log_debug(LOGOPT_DEBUG, "libldap: %s", msg);
# 168| free(msg);
Error: CLANG_WARNING: [#def126]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:1576:3: warning[unix.Malloc]: Use of memory after it is freed
# 1574| use_tls, tls_required, auth_required, authtype);
# 1575| if (authtype && !strncmp(authtype, "EXTERNAL", 8)) {
# 1576|-> debug(logopt, MODPREFIX "external cert: %s",
# 1577| extern_cert ? extern_cert : "ldap default");
# 1578| debug(logopt, MODPREFIX "external key: %s ",
Error: CLANG_WARNING: [#def127]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:1578:3: warning[unix.Malloc]: Use of memory after it is freed
# 1576| debug(logopt, MODPREFIX "external cert: %s",
# 1577| extern_cert ? extern_cert : "ldap default");
# 1578|-> debug(logopt, MODPREFIX "external key: %s ",
# 1579| extern_key ? extern_key : "ldap default");
# 1580| } else {
Error: CLANG_WARNING: [#def128]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:2388:12: warning[unix.Malloc]: Use of memory allocated with size zero
# 2386| if (*tmp == '%') {
# 2387| if (escaped) {
# 2388|-> *ptr++ = *tmp++;
# 2389| if (!look_for_close)
# 2390| escaped = 0;
Error: CLANG_WARNING: [#def129]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:2405:11: warning[unix.Malloc]: Use of memory allocated with size zero
# 2403| } else {
# 2404| escaped = 0;
# 2405|-> *ptr++ = *tmp++;
# 2406| }
# 2407| }
Error: CLANG_WARNING: [#def130]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:2408:7: warning[unix.Malloc]: Use of memory allocated with size zero
# 2406| }
# 2407| }
# 2408|-> *ptr = '\0';
# 2409| *key = new;
# 2410|
Error: CLANG_WARNING: [#def131]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:2948:3: warning[deadcode.DeadStores]: Value stored to 'k_len' is never read
# 2946| /* By definition keys should be unique within each map entry */
# 2947| k_val = NULL;
# 2948|-> k_len = 0;
# 2949|
# 2950| count = ldap_count_values_len(bvKey);
Error: CLANG_WARNING: [#def132]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_ldap.c:3637:3: warning[deadcode.DeadStores]: Value stored to 'k_len' is never read
# 3635| /* By definition keys should be unique within each map entry */
# 3636| k_val = NULL;
# 3637|-> k_len = 0;
# 3638|
# 3639| count = ldap_count_values_len(bvKey);
Error: CPPCHECK_WARNING: [#def133]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def134]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:347:8: warning[core.NullDereference]: Array access (via field 'argv') results in a null pointer dereference
# 345| }
# 346|
# 347|-> if (*new->m[i].argv[0] == '/') {
# 348| if (strcmp(new->m[i].argv[0], ctxt->m[i].argv[0]))
# 349| open_lookup("file", MODPREFIX,
Error: CLANG_WARNING: [#def135]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:420:30: warning[core.NullDereference]: Access to field 'type' results in a dereference of a null pointer (loaded from field 'mod')
# 418| this = list_entry(p, struct nss_source, list);
# 419|
# 420|-> if (!strcmp(this->source, ctxt->m[i].mod->type)) {
# 421| new->m[i].mod = ctxt->m[i].mod;
# 422| if (reinit_lookup(new->m[i].mod, this->source,
Error: GCC_ANALYZER_WARNING (CWE-476): [#def136]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c: scope_hint: In function ‘lookup_reinit’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:420:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:24: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:24: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:403:17: note: in expansion of macro ‘INIT_LIST_HEAD’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:415:17: note: in expansion of macro ‘list_for_each’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:415:17: note: in expansion of macro ‘list_for_each’
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_multi.c:415:17: note: in expansion of macro ‘list_for_each’
# 418| this = list_entry(p, struct nss_source, list);
# 419|
# 420|-> if (!strcmp(this->source, ctxt->m[i].mod->type)) {
# 421| new->m[i].mod = ctxt->m[i].mod;
# 422| if (reinit_lookup(new->m[i].mod, this->source,
Error: CPPCHECK_WARNING: [#def137]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_program.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def138]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_sss.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def139]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_userhome.c:83:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 81|
# 82| if (ret == CHE_FAIL) {
# 83|-> ret = chdir("/");
# 84| return NSS_STATUS_UNAVAIL;
# 85| }
Error: CLANG_WARNING: [#def140]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_userhome.c:93:2: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 91| }
# 92|
# 93|-> ret = chdir("/");
# 94|
# 95| return NSS_STATUS_SUCCESS;
Error: CPPCHECK_WARNING: [#def141]
autofs-5.1.9-build/autofs-5.1.9/modules/lookup_yp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def142]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_autofs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def143]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_bind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def144]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_bind.c:97:7: warning[deadcode.DeadStores]: Value stored to 'o_len' during its initialization is never read
# 95| if (*name != '/' && !symlnk && options) {
# 96| const char *comma;
# 97|-> int o_len = strlen(options) + 1;
# 98|
# 99| for (comma = options; *comma != '\0';) {
Error: CPPCHECK_WARNING: [#def145]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_changer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def146]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_ext2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def147]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_generic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def148]
autofs-5.1.9-build/autofs-5.1.9/modules/mount_nfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def149]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def150]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c:1545:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1543| if (entry->fs && !*entry->fs)
# 1544| return 0;
# 1545|-> entry->rfs = strdup(entry->fs);
# 1546| if (!entry->rfs) {
# 1547| error(logopt, MODPREFIX
Error: CLANG_WARNING: [#def151]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c:1908:17: warning[core.NullDereference]: Access to field 'flags' results in a dereference of a null pointer (loaded from variable 'defaults')
# 1906| memset(entry, 0, sizeof(struct amd_entry));
# 1907|
# 1908|-> entry->flags = defaults->flags;
# 1909|
# 1910| if (defaults->type) {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def152]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c: scope_hint: In function ‘dup_defaults_entry’
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c:1908:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘defaults’
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:24: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c:33: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c:2232:9: note: in expansion of macro ‘INIT_LIST_HEAD’
autofs-5.1.9-build/autofs-5.1.9/include/list.h:206:9: note: in expansion of macro ‘container_of’
autofs-5.1.9-build/autofs-5.1.9/modules/parse_amd.c:2028:42: note: in expansion of macro ‘list_entry’
# 1906| memset(entry, 0, sizeof(struct amd_entry));
# 1907|
# 1908|-> entry->flags = defaults->flags;
# 1909|
# 1910| if (defaults->type) {
Error: CPPCHECK_WARNING: [#def153]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-121): [#def154]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c: scope_hint: In function ‘sun_mount’
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:605:33: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:36: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1621:62: note: in expansion of macro ‘IS_MM’
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1169:13: note: in expansion of macro ‘IS_MM_ROOT’
autofs-5.1.9-build/autofs-5.1.9/include/automount.h:33: included_from: Included from here.
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:604:25: note: in expansion of macro ‘warn’
# 603| if (np > noptions + len) {
# 604| warn(ap->logopt, MODPREFIX "options string truncated");
# 605|-> np[len] = '\0';
# 606| } else if (np > noptions) {
# 607| *(np - 1) = '\0';
Error: CLANG_WARNING: [#def155]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1023:14: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1021| p = ent;
# 1022|
# 1023|-> myoptions = strdup(g_options);
# 1024| if (!myoptions) {
# 1025| char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
Error: CLANG_WARNING: [#def156]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1036:18: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
# 1034|
# 1035| p = parse_options(p, &newopt, logopt);
# 1036|-> if (newopt && strstr(newopt, myoptions)) {
# 1037| free(myoptions);
# 1038| myoptions = newopt;
Error: CLANG_WARNING: [#def157]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1044:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'myoptions'
# 1042| /* Ignore non-error NULL return */
# 1043| if (!tmp && errno) {
# 1044|-> char *estr;
# 1045|
# 1046| estr = strerror_r(errno, buf, MAX_ERR_BUF);
Error: CLANG_WARNING: [#def158]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1063:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1061| loc = dequote(p, l, logopt);
# 1062| if (!loc) {
# 1063|-> if (strstr(myoptions, "fstype=autofs") &&
# 1064| strstr(myoptions, "hosts")) {
# 1065| warn(logopt, MODPREFIX "possible missing location");
Error: CLANG_WARNING: [#def159]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1099:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1097| ent_chunk = dequote(p, l, logopt);
# 1098| if (!ent_chunk) {
# 1099|-> if (strstr(myoptions, "fstype=autofs") &&
# 1100| strstr(myoptions, "hosts")) {
# 1101| warn(logopt, MODPREFIX
Error: CLANG_WARNING: [#def160]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1232:16: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1230| }
# 1231| } else {
# 1232|-> int loclen = strlen(loc);
# 1233| int namelen = strlen(name);
# 1234|
Error: CLANG_WARNING: [#def161]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1442:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'mnt_options'
# 1440| tmp = concat_options(options, mnt_options);
# 1441| /* Ignore non-error NULL return */
# 1442|-> if (!tmp && errno) {
# 1443| char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
# 1444| error(ap->logopt, MODPREFIX "concat_options: %s", estr);
Error: CLANG_WARNING: [#def162]
autofs-5.1.9-build/autofs-5.1.9/modules/parse_sun.c:1454:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'options'
# 1452| }
# 1453|
# 1454|-> debug(ap->logopt, MODPREFIX "gathered options: %s", options);
# 1455|
# 1456| if (check_is_multi(p)) {
Error: CPPCHECK_WARNING: [#def163]
autofs-5.1.9-build/autofs-5.1.9/modules/replicated.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def164]
autofs-5.1.9-build/autofs-5.1.9/modules/replicated.c:769:6: warning[deadcode.DeadStores]: Although the value stored to 'kern_vers' is used in the enclosing expression, the value is never actually read from 'kern_vers'
# 767| if (nfs_mount_uses_string_options &&
# 768| defaults_get_mount_wait() == -1 &&
# 769|-> (kern_vers = linux_version_code()) > KERNEL_VERSION(2, 6, 22)) {
# 770| if (!this)
# 771| return 1;
Error: CLANG_WARNING: [#def165]
autofs-5.1.9-build/autofs-5.1.9/modules/replicated.c:1029:3: warning[unix.Malloc]: Argument to free() is offset by 1 byte from the start of memory allocated by strdup()
# 1027| "hostname lookup for %s failed: %s",
# 1028| name, gai_strerror(ret));
# 1029|-> free(name);
# 1030| return 0;
# 1031| }
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-230.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | autofs-5.1.9-7.fc41 |
store-results-to | /tmp/tmpi3bzv4k_/autofs-5.1.9-7.fc41.tar.xz |
time-created | 2024-07-03 12:03:11 |
time-finished | 2024-07-03 12:06:27 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpi3bzv4k_/autofs-5.1.9-7.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpi3bzv4k_/autofs-5.1.9-7.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |