Task #926 - nfs-utils-2.6.4-0.rc6.fc41/scan-results.err
back to task #926download
Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/auth.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-127): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/auth.c: scope_hint: In function ‘auth_fixpath’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/auth.c:317:33: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/auth.c:317:33: note: valid subscripts for ‘epath’ are ‘[0]’ to ‘[4096]’ # └───────────────────────┘ # ^ # 315| *cp++ = *sp; # 316| } # 317|-> while (cp > path+1 && cp[-1] == '/') # 318| cp--; # 319| *cp = '\0'; Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/cache.c:831: warning[nullPointer]: Possible null pointer dereference: exp # 829| if (prev == exp) { # 830| /* try a submount */ # 831|-> path = next_mnt(&mnt, exp->m_export.e_path); # 832| if (!path) { # 833| next_exp = exp->m_next; Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/cache.c:1337:20: warning[unix.Malloc]: Use of memory after it is freed # 1335| __func__, server, rootpath); # 1336| # 1337|-> if (last_path && strcmp(rootpath, last_path) == 0) { # 1338| len = snprintf(ptr, remaining, "+%s", server); # 1339| if (len < 0) { Error: CPPCHECK_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/cache.c:1810: error[uninitvar]: Uninitialized variable: buf # 1808| qword_add(&bp, &blen, exp->m_client->m_hostname); # 1809| qword_addeol(&bp, &blen); # 1810|-> if (blen <= 0 || cache_write(f, buf, bp - buf) != bp - buf) blen = -1; # 1811| close(f); # 1812| if (blen < 0) return -1; Error: CPPCHECK_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/cache.c:1848: error[uninitvar]: Uninitialized variable: buf # 1846| qword_addint(&bp, &blen, len); # 1847| qword_addeol(&bp, &blen); # 1848|-> if (blen <= 0 || cache_write(f, buf, bp - buf) != bp - buf) { # 1849| close(f); # 1850| return NULL; Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/export.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/fsloc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/fsloc.c:134:9: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 132| ptr++; # 133| list = malloc(listsize * sizeof(char *)); # 134|-> copy = strdup(data); # 135| if (copy) # 136| xlog(L_NOTICE, "converted to %s", copy); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4clients.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4clients.c: scope_hint: In function ‘add_id’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4clients.c:109:17: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ /usr/include/sys/types.h:179: included_from: Included from here. /usr/include/stdlib.h:514: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4clients.c:9: included_from: Included from here. # 107| # 108| if (asprintf(&path, "/proc/fs/nfsd/clients/%lu/info", key->num) < 0) # 109|-> return; # 110| # 111| f = fopen(path, "r"); Error: GCC_ANALYZER_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4clients.c:146:31: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 144| key->vers, key->clientid ?: "-none-", # 145| key->addr ?: "-none-"); # 146|-> if (!key->unconfirmed && key->wid >= 0) { # 147| inotify_rm_watch(clients_fd, key->wid); # 148| key->wid = -1; Error: GCC_ANALYZER_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4clients.c:146:31: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ # 144| key->vers, key->clientid ?: "-none-", # 145| key->addr ?: "-none-"); # 146|-> if (!key->unconfirmed && key->wid >= 0) { # 147| inotify_rm_watch(clients_fd, key->wid); # 148| key->wid = -1; Error: CPPCHECK_WARNING (CWE-562): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/v4root.c:115: error[invalidLifetime]: Using object that points to local variable 'uuid_s' that is out of scope. # 113| eep.e_uuid = uuid_s; # 114| } # 115|-> set_pseudofs_security(&eep); # 116| exp = export_create(&eep, 0); # 117| if (exp == NULL) Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/export/xtab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/rmtab.c:24: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/include/ha-callout.h:53:12: warning[deadcode.DeadStores]: Value stored to 'pid' is never read # 51| case -1: perror("fork"); # 52| break; # 53|-> default: pid = waitpid(pid, &ret, 0); # 54| } # 55| sigaction(SIGCHLD, &oldact, &newact); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/junction/nfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/junction/path.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c: scope_hint: In function 'is_tag' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c:1748:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'new' where non-null expected <built-in>: note: argument 1 of '__builtin_strchr' must be non-null # 1746| if (*name == '"') { # 1747| char * new = strdup(name+1); # 1748|-> end = strchr(new, '"'); # 1749| if (end != NULL) { # 1750| *end = 0; Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c:43: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c: scope_hint: In function 'is_taggedcomment' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c:1840:45: warning[-Wanalyzer-null-dereference]: dereference of NULL 'end' # 1838| end = strchr(name, ':'); # 1839| if (end) *(end--) = 0; # 1840|-> while (end && end > name && isblank(*end)) # 1841| *(end--)=0; # 1842| Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c:1988:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'thisline' # 1986| } # 1987| # 1988|-> qbuff = make_outbuffer(thisline); # 1989| if (qbuff == NULL) # 1990| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c: scope_hint: In function 'append_line' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c:1988:25: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(buff)' # 1986| } # 1987| # 1988|-> qbuff = make_outbuffer(thisline); # 1989| if (qbuff == NULL) # 1990| return -1; Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/conffile.c:2339:2: warning[unix.Malloc]: Potential memory leak # 2337| # 2338| cleanup: # 2339|-> flush_outqueue(&inqueue, NULL); # 2340| flush_outqueue(&outqueue, NULL); # 2341| Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/exports.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/exports.c: scope_hint: In function 'parseopts' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/exports.c:662:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'opt' where non-null expected nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/exports.c:23: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of 'strcmp' must be non-null # 660| # 661| /* process keyword */ # 662|-> if (strcmp(opt, "ro") == 0) # 663| setflags(NFSEXP_READONLY, active, ep); # 664| else if (strcmp(opt, "rw") == 0) Error: COMPILER_WARNING (CWE-126): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/getport.c:459:24: warning[-Wstringop-overread]: 'strndup' specified bound 108 exceeds source size 14 # 459 | return strndup(sun->sun_path, sizeof(sun->sun_path)); # | ^ nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/getport.c: scope_hint: In function 'main' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/getport.c:1119:28: note: source object allocated here # 1119 | struct sockaddr_in addr = { # | ^ # 457| switch (sap->sa_family) { # 458| case AF_LOCAL: # 459|-> return strndup(sun->sun_path, sizeof(sun->sun_path)); # 460| case AF_INET: # 461| if (inet_ntop(AF_INET, (const void *)&sin->sin_addr.s_addr, Error: COMPILER_WARNING (CWE-126): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/getport.c:459:24: warning[-Wstringop-overread]: 'strndup' specified bound 108 exceeds source size 26 # 459 | return strndup(sun->sun_path, sizeof(sun->sun_path)); # | ^ nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nsm/rpc.c: scope_hint: In function 'nsm_xmit_getaddr.constprop' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nsm/rpc.c:231:29: note: source object allocated here # 231 | struct sockaddr_in6 addr; # | ^ # 457| switch (sap->sa_family) { # 458| case AF_LOCAL: # 459|-> return strndup(sun->sun_path, sizeof(sun->sun_path)); # 460| case AF_INET: # 461| if (inet_ntop(AF_INET, (const void *)&sin->sin_addr.s_addr, Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/mydaemon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rmtab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpc_socket.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcdispatch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-479): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c: scope_hint: In function 'closedown' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:56:25: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to 'exit' from within signal handler nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/include/nfslib.h:24: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:34: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:55:21: note: in expansion of macro 'NFSCTL_TCPISSET' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:56:25: note: '_exit' is a possible signal-safe alternative for 'exit' # 54| # 55| if (NFSCTL_TCPISSET(_rpcprotobits) == 0) # 56|-> exit(0); # 57| # 58| if (size == 0) Error: GCC_ANALYZER_WARNING (CWE-479): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:65:25: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to 'exit' from within signal handler nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:55:21: note: in expansion of macro 'NFSCTL_TCPISSET' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:65:25: note: '_exit' is a possible signal-safe alternative for 'exit' # 63| openfd++; # 64| if (openfd <= 1) # 65|-> exit(0); # 66| } # 67| Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/rpcmisc.c:125:26: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 123| sock = 0; # 124| if (getsockname(0, (struct sockaddr *) &saddr, &asize) == 0 # 125|-> && saddr.sin_family == AF_INET) { # 126| socklen_t ssize = sizeof(int); # 127| int fdtype = 0; Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/svc_create.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/wildmat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c: scope_hint: In function 'xstrndup' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c:33:6: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of '__builtin_strncpy' must be non-null # 31| # 32| t = xmalloc(n+1); # 33|-> strncpy(t,s,n); # 34| t[n] = 0; # 35| Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c:33:6: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull' # 31| # 32| t = xmalloc(n+1); # 33|-> strncpy(t,s,n); # 34| t[n] = 0; # 35| Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c: scope_hint: In function 'xstrconcat2' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c:46:6: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of '__builtin_strcpy' must be non-null # 44| if (!t) t = ""; # 45| res = xmalloc(strlen(s) + strlen(t) + 1); # 46|-> strcpy(res, s); # 47| strcat(res, t); # 48| return res; Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c: scope_hint: In function 'xstrconcat3' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c:62:6: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of '__builtin_strcpy' must be non-null # 60| if (!u) u = ""; # 61| res = xmalloc(strlen(s) + strlen(t) + strlen(u) + 1); # 62|-> strcpy(res, s); # 63| strcat(res, t); # 64| strcat(res, u); Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c: scope_hint: In function 'xstrconcat4' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfs/xcommon.c:82:6: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected <built-in>: note: argument 1 of '__builtin_strcpy' must be non-null # 80| if (!v) v = ""; # 81| res = xmalloc(strlen(s) + strlen(t) + strlen(u) + strlen(v) + 1); # 82|-> strcpy(res, s); # 83| strcat(res, t); # 84| strcat(res, u); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:416: error[uninitvar]: Uninitialized variable: r->field # 414| if (local_realms) { # 415| TAILQ_FOREACH(r, &local_realms->fields, link) { # 416|-> siz += (strlen(r->field)+4); # 417| } # 418| buf = malloc(siz); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:420:10: warning[unix.Malloc]: Use of memory allocated with size zero # 418| buf = malloc(siz); # 419| if (buf) { # 420|-> *buf = 0; # 421| TAILQ_FOREACH(r, &local_realms->fields, link) { # 422| sprintf(buf+strlen(buf), "'%s' ", r->field); Error: GCC_ANALYZER_WARNING (CWE-122): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c: scope_hint: In function 'nfs4_init_name_mapping' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:420:38: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:697:9: note: in expansion of macro 'RUN_TRANSLATIONS' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:62: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:403:9: note: in expansion of macro 'IDMAP_LOG' nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/include/conffile.h:36: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/nfsidmap_private.h:37: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:61: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/libnfsidmap.c:420:38: note: write of 1 byte to beyond the end of the region # 418| buf = malloc(siz); # 419| if (buf) { # 420|-> *buf = 0; # 421| TAILQ_FOREACH(r, &local_realms->fields, link) { # 422| sprintf(buf+strlen(buf), "'%s' ", r->field); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/nss.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/nss.c:415: error[uninitvar]: Uninitialized variable: r->field # 413| realms = get_local_realms(); # 414| TAILQ_FOREACH(r, &realms->fields, link) { # 415|-> if (strcmp(r->field, princ_realm) == 0) { # 416| found = 1; # 417| break; Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/regex.c:376:3: warning[deadcode.DeadStores]: Value stored to 'domain' is never read # 374| goto out; # 375| if (domain == NULL) # 376|-> domain = get_default_domain(); # 377| err = -getpwuid_r(uid, &pwbuf, buf, buflen, &pw); # 378| if (pw == NULL) Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/static.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:545:8: warning[deadcode.DeadStores]: Although the value stored to 'f_len' is used in the enclosing expression, the value is never actually read from 'f_len' # 543| # 544| if (idtype == IDTYPE_USER) { # 545|-> if ((f_len = snprintf(filter, LDAP_FILT_MAXSIZ, # 546| "(&(objectClass=%s)(%s=%s))", # 547| ldap_map.NFSv4_person_objcls, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:557:8: warning[deadcode.DeadStores]: Although the value stored to 'f_len' is used in the enclosing expression, the value is never actually read from 'f_len' # 555| } # 556| else if (idtype == IDTYPE_GROUP) { # 557|-> if ((f_len = snprintf(filter, LDAP_FILT_MAXSIZ, # 558| "(&(objectClass=%s)(%s=%s))", # 559| ldap_map.NFSv4_group_objcls, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:606:8: warning[deadcode.DeadStores]: Although the value stored to 'entry' is used in the enclosing expression, the value is never actually read from 'entry' # 604| } # 605| # 606|-> if (!(entry = ldap_first_entry(ld, result))) { # 607| lerr = ldap_result2error(ld, result, 0); # 608| IDMAP_LOG(2, ("umich_name_to_ids: ldap_first_entry: " Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:708:8: warning[deadcode.DeadStores]: Although the value stored to 'f_len' is used in the enclosing expression, the value is never actually read from 'f_len' # 706| # 707| if (idtype == IDTYPE_USER) { # 708|-> if ((f_len = snprintf(filter, LDAP_FILT_MAXSIZ, # 709| "(&(objectClass=%s)(%s=%s))", # 710| ldap_map.NFSv4_person_objcls, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:719:8: warning[deadcode.DeadStores]: Although the value stored to 'f_len' is used in the enclosing expression, the value is never actually read from 'f_len' # 717| base = linfo->people_tree; # 718| } else if (idtype == IDTYPE_GROUP) { # 719|-> if ((f_len = snprintf(filter, LDAP_FILT_MAXSIZ, # 720| "(&(objectClass=%s)(%s=%s))", # 721| ldap_map.NFSv4_group_objcls, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:770:8: warning[deadcode.DeadStores]: Although the value stored to 'entry' is used in the enclosing expression, the value is never actually read from 'entry' # 768| goto out_unbind; # 769| # 770|-> if (!(entry = ldap_first_entry(ld, result))) { # 771| lerr = ldap_result2error(ld, result, 0); # 772| IDMAP_LOG(2, ("umich_id_to_name: ldap_first_entry: " Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:848:7: warning[deadcode.DeadStores]: Although the value stored to 'f_len' is used in the enclosing expression, the value is never actually read from 'f_len' # 846| */ # 847| err = -EINVAL; # 848|-> if ((f_len = snprintf(filter, LDAP_FILT_MAXSIZ, # 849| "(&(objectClass=%s)(%s=%s))", # 850| ldap_map.NFSv4_person_objcls, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:889:8: warning[deadcode.DeadStores]: Although the value stored to 'entry' is used in the enclosing expression, the value is never actually read from 'entry' # 887| } # 888| # 889|-> if (!(entry = ldap_first_entry(ld, result))) { # 890| lerr = ldap_result2error(ld, result, 0); # 891| IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_first_entry: " Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:908:18: warning[deadcode.DeadStores]: Although the value stored to 'f_len' is used in the enclosing expression, the value is never actually read from 'f_len' # 906| * Collect the groups the user belongs to # 907| */ # 908|-> if ((f_len = snprintf(filter, LDAP_FILT_MAXSIZ, # 909| "(&(objectClass=%s)(%s=%s))", # 910| ldap_map.NFSv4_person_objcls, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:954:19: warning[deadcode.DeadStores]: Although the value stored to 'entry' is used in the enclosing expression, the value is never actually read from 'entry' # 952| } # 953| # 954|-> if (!(entry = ldap_first_entry(ld, result))) { # 955| lerr = ldap_result2error(ld, result, 0); # 956| IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_first_entry: " Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:1405:40: warning[unix.cstring.BadSizeArg]: Potential buffer overflow. Replace with 'sizeof(missing_msg) - strlen(missing_msg) - 1' or use a safer 'strlcat' API # 1403| /* Verify required information is supplied */ # 1404| if (server_in == NULL || strlen(server_in) == 0) # 1405|-> strncat(missing_msg, "LDAP_server ", sizeof(missing_msg)-1); # 1406| if (ldap_info.base == NULL || strlen(ldap_info.base) == 0) # 1407| strncat(missing_msg, "LDAP_base ", sizeof(missing_msg)-1); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nfsidmap/umich_ldap.c:1407:38: warning[unix.cstring.BadSizeArg]: Potential buffer overflow. Replace with 'sizeof(missing_msg) - strlen(missing_msg) - 1' or use a safer 'strlcat' API # 1405| strncat(missing_msg, "LDAP_server ", sizeof(missing_msg)-1); # 1406| if (ldap_info.base == NULL || strlen(ldap_info.base) == 0) # 1407|-> strncat(missing_msg, "LDAP_base ", sizeof(missing_msg)-1); # 1408| if (strlen(missing_msg) != 0) { # 1409| IDMAP_LOG(0, ("umichldap_init: Missing required information: " Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/nsm/file.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/reexport/fsidd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/nfs-server-generator.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c:69:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c: scope_hint: In function ‘systemd_escape’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c:9: included_from: Included from here. # 67| static char *hexify(unsigned char c, char *p) # 68| { # 69|-> *p++ = '\\'; # 70| *p++ = 'x'; # 71| *p++ = hex[c >> 4]; Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c:69:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c: scope_hint: In function ‘systemd_escape’ # 67| static char *hexify(unsigned char c, char *p) # 68| { # 69|-> *p++ = '\\'; # 70| *p++ = 'x'; # 71| *p++ = hex[c >> 4]; Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c: scope_hint: In function ‘systemd_escape’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c:104:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘result’ # 102| if (!*path) { # 103| /* root directory "/" becomes is encoded as a single "-" */ # 104|-> *p++ = '-'; # 105| goto out; # 106| } Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/systemd/systemd.c:125:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’ # 123| } else if (isalnum(c) || c == ':' || c == '.' || c == '_') # 124| /* these characters are not replaced */ # 125|-> *p++ = c; # 126| else # 127| /* replace with "\x2d" escape sequence */ Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/locktest/testlk.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsconf/nfsconfcli.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsconf/nfsconfcli.c:225:4: warning[deadcode.DeadStores]: Value stored to 'mode' is never read # 223| /* setting an empty string is same as unsetting */ # 224| if (val!=NULL && *val == '\0') { # 225|-> mode = MODE_UNSET; # 226| val = NULL; # 227| } Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c: scope_hint: In function ‘fill_device_number’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c:37:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’ # 35| # 36| maj_s = p = s; # 37|-> for ( ; *p != ':' && *p != '\0'; p++) # 38| ; # 39| Error: GCC_ANALYZER_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c:63:24: warning[-Wanalyzer-malloc-leak]: leak of ‘device.mountpoint’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c: scope_hint: In function ‘get_mountinfo’ # 61| di->device_number = strdup(device_number); # 62| di->dev = 0; # 63|-> di->mountpoint = NULL; # 64| di->fstype = NULL; # 65| } Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c:64:13: warning[unix.Malloc]: Potential memory leak # 62| di->dev = 0; # 63| di->mountpoint = NULL; # 64|-> di->fstype = NULL; # 65| } # 66| Error: GCC_ANALYZER_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c:64:20: warning[-Wanalyzer-malloc-leak]: leak of ‘device.fstype’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/nfsrahead/main.c: scope_hint: In function ‘get_mountinfo’ # 62| di->dev = 0; # 63| di->mountpoint = NULL; # 64|-> di->fstype = NULL; # 65| } # 66| Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/tools/rpcdebug/rpcdebug.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-discovery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-discovery.c:182:8: warning[core.NullDereference]: Access to field 'len' results in a dereference of a null pointer (loaded from variable 'serial') # 180| * XXX: if released each time, maybe not need to compare # 181| */ # 182|-> if ((serial->len == disk->serial->len) && # 183| !memcmp(serial->data, disk->serial->data, serial->len)) { # 184| diskpath = bl_get_path(filepath, disk->paths); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:227:7: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined # 225| # 226| for (i = 0; i < vol->bv_vol_n; i++) # 227|-> sum += vol->bv_vols[i]->bv_size; # 228| return sum; # 229| } Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:285:33: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value # 283| return status; # 284| for (j = 1; j < vol->bv_vol_n; j++) { # 285|-> if (vol->bv_vols[j]->bv_size != # 286| vol->bv_vols[0]->bv_size) { # 287| BL_LOG_ERR("varying subvol size\n"); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:291:43: warning[core.UndefinedBinaryOperatorResult]: The left operand of '*' is a garbage value # 289| } # 290| } # 291|-> vol->bv_size = vol->bv_vols[0]->bv_size * vol->bv_vol_n; # 292| break; # 293| case BLOCK_VOLUME_CONCAT: Error: GCC_ANALYZER_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c: scope_hint: In function ‘decode_blk_volume’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:291:44: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*vol_70->bv_vols’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:50: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:328:9: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c: scope_hint: In function ‘decode_blk_volume’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:328:9: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:328:9: note: in expansion of macro ‘BLK_READBUF’ /usr/include/arpa/inet.h:22: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:39: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:329:9: note: in expansion of macro ‘READ32’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:241:9: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c: scope_hint: In function ‘decode_blk_volume’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:241:9: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:241:9: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:242:9: note: in expansion of macro ‘READ32’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:267:17: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c: scope_hint: In function ‘decode_blk_volume’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:267:17: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:267:17: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-discovery.h:138:9: note: in expansion of macro ‘READ64’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:268:17: note: in expansion of macro ‘READ_SECTOR’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:268:17: note: in expansion of macro ‘READ_SECTOR’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:268:17: note: in expansion of macro ‘READ_SECTOR’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:274:17: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c: scope_hint: In function ‘decode_blk_volume’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:274:17: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:274:17: note: in expansion of macro ‘BLK_READBUF’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/device-process.c:275:17: note: in expansion of macro ‘READ32’ # 289| } # 290| } # 291|-> vol->bv_size = vol->bv_vols[0]->bv_size * vol->bv_vol_n; # 292| break; # 293| case BLOCK_VOLUME_CONCAT: Error: GCC_ANALYZER_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/dm-device.c: scope_hint: In function ‘dm_device_create’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/dm-device.c:429:45: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pos’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/blkmapd/dm-device.c: scope_hint: In function ‘dm_device_create’ # 427| (long long unsigned) stripe_unit, &pos); # 428| /* Copy subdev major:minor to params */ # 429|-> tmp = table->params + pos; # 430| len = DM_PARAMS_LEN - pos; # 431| for (i = 0; i < node->bv_vol_n; i++) { Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/exportfs/exportfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/exportfs/exportfs.c:278:7: warning[deadcode.DeadStores]: Although the value stored to 'htype' is used in the enclosing expression, the value is never actually read from 'htype' # 276| int htype; # 277| # 278|-> if ((htype = client_gettype(hname)) == MCL_FQDN) { # 279| ai = host_addrinfo(hname); # 280| if (ai != NULL) { Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gss_names.c:135:17: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 133| # 134| if (!get_hostbased_client_name(client_name, mech, &hname)) { # 135|-> buf->length = strlen(hname) + 1; # 136| buf->value = hname; # 137| } else { Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gss_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gss_util.c:308:4: warning[deadcode.DeadStores]: Value stored to 'ignore_maj_stat' is never read # 306| printerr(1, "Unable to obtain credentials for '%.*s'\n", # 307| (int)pbuf.length, (char *)pbuf.value); # 308|-> ignore_maj_stat = gss_release_buffer(&ignore_min_stat, # 309| &pbuf); # 310| } Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gss_util.c:313:2: warning[deadcode.DeadStores]: Value stored to 'ignore_maj_stat' is never read # 311| } # 312| # 313|-> ignore_maj_stat = gss_release_name(&ignore_min_stat, &target_name); # 314| # 315| return (maj_stat == GSS_S_COMPLETE); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gss_util.c:336:2: warning[deadcode.DeadStores]: Value stored to 'maj_stat' is never read # 334| goto out; # 335| } # 336|-> maj_stat = gss_release_oid_set(&min_stat, &supported_mechs); # 337| retval = 0; # 338| out: Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:368:24: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 366| fail: # 367| printerr(0, "ERROR: failed to parse %s/info\n", clp->relpath); # 368|-> clp->upcall_address = strdup(address); # 369| clp->upcall_port = strdup(port); # 370| clp->upcall_program = program; Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:369:21: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 367| printerr(0, "ERROR: failed to parse %s/info\n", clp->relpath); # 368| clp->upcall_address = strdup(address); # 369|-> clp->upcall_port = strdup(port); # 370| clp->upcall_program = program; # 371| clp->upcall_vers = version; Error: GCC_ANALYZER_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c: scope_hint: In function ‘gssd_read_service_info’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:370:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘program’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.h:35: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:69: included_from: Included from here. # 368| clp->upcall_address = strdup(address); # 369| clp->upcall_port = strdup(port); # 370|-> clp->upcall_program = program; # 371| clp->upcall_vers = version; # 372| clp->upcall_protoname = strdup(protoname); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:372:26: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 370| clp->upcall_program = program; # 371| clp->upcall_vers = version; # 372|-> clp->upcall_protoname = strdup(protoname); # 373| clp->upcall_service = strdup(service); # 374| free(servername); Error: GCC_ANALYZER_WARNING (CWE-416): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c: scope_hint: In function ‘gssd_destroy_client’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:436:9: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘clp’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:67: included_from: Included from here. # 434| gssd_destroy_client(struct clnt_info *clp) # 435| { # 436|-> printerr(4, "destroying client %s\n", clp->relpath); # 437| # 438| if (clp->krb5_ev) { Error: GCC_ANALYZER_WARNING (CWE-479): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c: scope_hint: In function ‘sig_die’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:1011:17: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd.c:1011:17: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 1009| gssd_destroy_krb5_principals(root_uses_machine_creds); # 1010| printerr(1, "forced exiting on signal %d\n", signal); # 1011|-> exit(0); # 1012| } # 1013| Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/gssd_proc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:782:10: warning[deadcode.DeadStores]: Although the value stored to 'code' is used in the enclosing expression, the value is never actually read from 'code' # 780| # 781| printerr(4, "Scanning keytab for %s/*@%s\n", service, realm); # 782|-> while ((code = krb5_kt_next_entry(context, kt, kte, &cursor)) == 0) { # 783| if ((code = krb5_unparse_name(context, kte->principal, # 784| &pname))) { Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1082:4: warning[deadcode.DeadStores]: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' # 1080| # 1081| while (!found && # 1082|-> (ret = krb5_cc_next_cred(context, ccache, &cur, &creds)) == 0) { # 1083| if (creds.server->length == 2 && # 1084| data_is_equal(creds.server->realm, Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1213:9: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value # 1211| } # 1212| # 1213|-> ple = get_ple_by_princ(context, kte.principal); # 1214| k5_free_kt_entry(context, &kte); # 1215| if (ple == NULL) { Error: GCC_ANALYZER_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c: scope_hint: In function ‘gssd_refresh_krb5_machine_credential_internal’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1213:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘kte.principal’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:115: included_from: Included from here. # 1211| } # 1212| # 1213|-> ple = get_ple_by_princ(context, kte.principal); # 1214| k5_free_kt_entry(context, &kte); # 1215| if (ple == NULL) { Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1336:47: warning[unix.Malloc]: Use of memory after it is freed # 1334| # 1335| pthread_mutex_lock(&ple_lock); # 1336|-> for (ple = gssd_k5_kt_princ_list; ple; ple = ple->next) { # 1337| if (!ple->ccname) # 1338| continue; Error: GCC_ANALYZER_WARNING (CWE-416): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c: scope_hint: In function ‘gssd_get_krb5_machine_cred_list’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1336:52: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘ple’ # 1334| # 1335| pthread_mutex_lock(&ple_lock); # 1336|-> for (ple = gssd_k5_kt_princ_list; ple; ple = ple->next) { # 1337| if (!ple->ccname) # 1338| continue; Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1375:24: warning[unix.Malloc]: Use of memory after it is freed # 1373| l = tmplist; # 1374| } # 1375|-> if ((l[i++] = strdup(ple->ccname)) == NULL) { # 1376| gssd_free_krb5_machine_cred_list(l); # 1377| retval = ENOMEM; Error: GCC_ANALYZER_WARNING (CWE-416): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1375:41: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘ple’ # 1373| l = tmplist; # 1374| } # 1375|-> if ((l[i++] = strdup(ple->ccname)) == NULL) { # 1376| gssd_free_krb5_machine_cred_list(l); # 1377| retval = ENOMEM; Error: CPPCHECK_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/gssd/krb5_util.c:1613: error[memleakOnRealloc]: Common realloc mistake: 'allowed_enctypes' nulled but not freed upon failure # 1611| if (allowed_etypes) { # 1612| TAILQ_FOREACH(node, &(allowed_etypes->fields), link) { # 1613|-> allowed_enctypes = realloc(allowed_enctypes, # 1614| (num_allowed_enctypes + 1) * # 1615| sizeof(*allowed_enctypes)); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/idmapd/idmapd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/idmapd/idmapd.c:341:29: warning[unix.cstring.BadSizeArg]: Potential buffer overflow. Replace with 'sizeof(pipefsdir) - strlen(pipefsdir) - 1' or use a safer 'strlcat' API # 339| errx(1, "it is illegal to specify both -C and -S"); # 340| # 341|-> strncat(pipefsdir, "/nfs", sizeof(pipefsdir)-1); # 342| # 343| daemon_init(fg); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/idmapd/idmapd.c:1073:9: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n' # 1071| while (*bp != '\0' && fldsz > 1) { # 1072| if (*bp == '\\') { # 1073|-> if ((n = sscanf(bp, "\\%03o", &val)) != 1) # 1074| return (-1); # 1075| if (val > UCHAR_MAX) Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/configfile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/configfile.c: scope_hint: In function ‘mountopts_convert’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/configfile.c:122:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘value’ where non-null expected nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/include/conffile.h:36: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/configfile.c:36: included_from: Included from here. <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 120| char *ch; # 121| # 122|-> ch = &value[strlen(value)-1]; # 123| switch (tolower(*ch)) { # 124| case 'k': Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:114:4: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 112| if (rpc_createerr.cf_stat == RPC_TIMEDOUT) { # 113| if (will_retry) # 114|-> pos = snprintf(tmp, (erreob - tmp), # 115| _("timed out, retrying")); # 116| else Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:117:4: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 115| _("timed out, retrying")); # 116| else # 117|-> pos = snprintf(tmp, (erreob - tmp), # 118| _("timed out, giving up")); # 119| } else { Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:124:5: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 122| if (bg) { # 123| if (will_retry) # 124|-> pos = snprintf(tmp, (erreob - tmp), # 125| _(", retrying")); # 126| else Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:127:5: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 125| _(", retrying")); # 126| else # 127|-> pos = snprintf(tmp, (erreob - tmp), # 128| _(", giving up")); # 129| } Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:169:4: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 167| if (error == ETIMEDOUT) { # 168| if (will_retry) # 169|-> pos = snprintf(tmp, (erreob - tmp), # 170| _("timed out, retrying")); # 171| else Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:172:4: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 170| _("timed out, retrying")); # 171| else # 172|-> pos = snprintf(tmp, (erreob - tmp), # 173| _("timed out, giving up")); # 174| } else { Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:177:5: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 175| if (bg) { # 176| if (will_retry) # 177|-> pos = snprintf(tmp, (erreob - tmp), # 178| _("%s, retrying"), # 179| strerror(error)); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/error.c:181:5: warning[deadcode.DeadStores]: Value stored to 'pos' is never read # 179| strerror(error)); # 180| else # 181|-> pos = snprintf(tmp, (erreob - tmp), # 182| _("%s, giving up"), # 183| strerror(error)); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/mount_libmount.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/mount_libmount.c:129:11: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 127| ret = nfsmount_string(src, tgt, type, flags, &opts, fake, bg); # 128| # 129|-> else if (strcmp(type, "nfs4") == 0) # 130| ret = nfs4mount(src, tgt, flags, &opts, fake, bg); # 131| else Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/mount_libmount.c: scope_hint: In function ‘try_mount’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/mount_libmount.c:129:18: warning[-Wanalyzer-null-argument]: use of NULL ‘type’ where non-null expected nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/mount_libmount.c:29: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 127| ret = nfsmount_string(src, tgt, type, flags, &opts, fake, bg); # 128| # 129|-> else if (strcmp(type, "nfs4") == 0) # 130| ret = nfs4mount(src, tgt, flags, &opts, fake, bg); # 131| else Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/mount_libmount.c:129:18: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘type’ where non-null expected /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 127| ret = nfsmount_string(src, tgt, type, flags, &opts, fake, bg); # 128| # 129|-> else if (strcmp(type, "nfs4") == 0) # 130| ret = nfs4mount(src, tgt, flags, &opts, fake, bg); # 131| else Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/network.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/network.c:1034:26: warning[deadcode.DeadStores]: Although the value stored to 'status' is used in the enclosing expression, the value is never actually read from 'status' # 1032| struct sockaddr dissolve; # 1033| # 1034|-> rpc_createerr.cf_stat = status = 0; # 1035| sock = get_socket(saddr, prot, CONNECT_TIMEOUT, FALSE, TRUE); # 1036| if (sock == RPC_ANYSOCK) { Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/nfs4mount.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/nfsmount.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/parse_opt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/stropts.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mount/utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c: scope_hint: In function ‘main’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c:829:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 2)’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c: scope_hint: In function ‘main’ # 827| { # 828| int fd = open("/dev/null", O_RDWR); # 829|-> (void) dup2(fd, 0); # 830| (void) dup2(fd, 1); # 831| (void) dup2(fd, 2); Error: GCC_ANALYZER_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c:830:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 2)’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c: scope_hint: In function ‘main’ # 828| int fd = open("/dev/null", O_RDWR); # 829| (void) dup2(fd, 0); # 830|-> (void) dup2(fd, 1); # 831| (void) dup2(fd, 2); # 832| if (fd > 2) (void) close(fd); Error: GCC_ANALYZER_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c:831:32: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 2)’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c: scope_hint: In function ‘main’ # 829| (void) dup2(fd, 0); # 830| (void) dup2(fd, 1); # 831|-> (void) dup2(fd, 2); # 832| if (fd > 2) (void) close(fd); # 833| } Error: GCC_ANALYZER_WARNING (CWE-775): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c:832:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/mountd.c: scope_hint: In function ‘main’ # 830| (void) dup2(fd, 1); # 831| (void) dup2(fd, 2); # 832|-> if (fd > 2) (void) close(fd); # 833| } # 834| setsid(); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/mountd/rmtab.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:168: error[memleakOnRealloc]: Common realloc mistake: 'haddr' nulled but not freed upon failure # 166| if (hosts && hosts->cnt) { # 167| struct conf_list_node *n; # 168|-> haddr = realloc(haddr, sizeof(char*) * hosts->cnt); # 169| TAILQ_FOREACH(n, &(hosts->fields), link) { # 170| haddr[hcounter] = n->field; Error: CPPCHECK_WARNING (CWE-457): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:170: error[uninitvar]: Uninitialized variable: n->field # 168| haddr = realloc(haddr, sizeof(char*) * hosts->cnt); # 169| TAILQ_FOREACH(n, &(hosts->fields), link) { # 170|-> haddr[hcounter] = n->field; # 171| hcounter++; # 172| } Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c: scope_hint: In function ‘main’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:170:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘haddr’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/support/include/conffile.h:36: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:28: included_from: Included from here. # 168| haddr = realloc(haddr, sizeof(char*) * hosts->cnt); # 169| TAILQ_FOREACH(n, &(hosts->fields), link) { # 170|-> haddr[hcounter] = n->field; # 171| hcounter++; # 172| } Error: GCC_ANALYZER_WARNING (CWE-131): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:187:41: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size # 185| } # 186| if (hcounter) { # 187|-> haddr = realloc(haddr, sizeof(char*) * hcounter+1); # 188| if(!haddr) { # 189| fprintf(stderr, "%s: unable to allocate " Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:194:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘haddr’ # 192| } # 193| } # 194|-> haddr[hcounter] = optarg; # 195| hcounter++; # 196| break; Error: GCC_ANALYZER_WARNING (CWE-122): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:194:41: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow # 192| } # 193| } # 194|-> haddr[hcounter] = optarg; # 195| hcounter++; # 196| break; Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:403:2: warning[deadcode.DeadStores]: Value stored to 'error' is never read # 401| goto out; # 402| } # 403|-> error = 0; # 404| # 405| /* Error: GCC_ANALYZER_WARNING (CWE-775): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfsd.c:420:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’ # 418| (void) dup2(fd, 0); # 419| (void) dup2(fd, 1); # 420|-> (void) dup2(fd, 2); # 421| } # 422| closeall(3); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsd/nfssvc.c:72:2: warning[deadcode.DeadStores]: Value stored to 'err' is never read # 70| * code from it and just check for the "threads" file afterward. # 71| */ # 72|-> err = system("/bin/mount -t nfsd nfsd " NFSD_FS_DIR " >/dev/null 2>&1"); # 73| # 74| err = stat(NFSD_THREAD_FILE, &statbuf); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/legacy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/nfsdcld.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-479): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/nfsdcld.c: scope_hint: In function ‘sig_die’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/nfsdcld.c:99:17: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/nfsdcld.c:99:17: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 97| if (signal_received) { # 98| xlog(D_GENERAL, "forced exiting on signal %d\n", signal); # 99|-> exit(0); # 100| } # 101| Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/nfsdcld.c:799:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'progname' # 797| evbase = event_base_new(); # 798| if (evbase == NULL) { # 799|-> fprintf(stderr, "%s: unable to allocate event base.\n", argv[0]); # 800| return 1; # 801| } Error: CPPCHECK_WARNING (CWE-401): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/nfsdcld.c:800: error[memleak]: Memory leak: progname # 798| if (evbase == NULL) { # 799| fprintf(stderr, "%s: unable to allocate event base.\n", argv[0]); # 800|-> return 1; # 801| } # 802| xlog_syslog(0); Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsdcld/sqlite.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c:302:3: warning[deadcode.DeadStores]: Value stored to 'mask' is never read # 300| continue; # 301| # 302|-> mask = 0; # 303| if ((ptr = strstr(buf, "uid:")) != NULL) # 304| mask = UIDKEYS; Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c: scope_hint: In function ‘key_invalidate’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c:317:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 315| # 316| if (verbose) { # 317|-> *(strchr(buf, '\n')) = '\0'; # 318| xlog_warn("invalidating '%s'", buf); # 319| } Error: GCC_ANALYZER_WARNING (CWE-476): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c:323:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 321| * The key is the first arugment in the string # 322| */ # 323|-> *(strchr(buf, ' ')) = '\0'; # 324| sscanf(buf, "%x", &key); # 325| Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c:412:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'keystr' # 410| # 411| if (geteuid() != 0) { # 412|-> xlog_err("Must be run as root."); # 413| return EXIT_FAILURE; # 414| } Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c: scope_hint: In function ‘main’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c:463:13: warning[-Wanalyzer-null-argument]: use of NULL ‘type’ where non-null expected nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsidmap/nfsidmap.c:6: included_from: Included from here. /usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null # 461| request_key("keyring", DEFAULT_KEYRING, NULL, KEY_SPEC_THREAD_KEYRING); # 462| # 463|-> if (strcmp(type, "uid") == 0) # 464| rc = id_lookup(value, key, USER); # 465| else if (strcmp(type, "gid") == 0) Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/nfsstat/nfsstat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/showmount/showmount.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/showmount/showmount.c: scope_hint: In function ‘main’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/showmount/showmount.c:315:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dumpv’ where non-null expected /usr/include/tirpc/rpc/rpc.h:49: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/showmount/showmount.c:21: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/showmount/showmount.c:269:9: note: in expansion of macro ‘clnt_destroy’ /usr/include/tirpc/rpc/types.h:97: included_from: Included from here. /usr/include/tirpc/rpc/rpc.h:38: included_from: Included from here. /usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null # 313| } # 314| # 315|-> qsort(dumpv, n, sizeof (char *), dump_cmp); # 316| # 317| for (i = 0; i < n; i++) { Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/notlist.c:224:10: warning[unix.Malloc]: Use of memory after it is freed # 222| # 223| while (*head) { # 224|-> next = (*head)->next; # 225| nlist_free(head, *head); # 226| free(*head); Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/rmtcall.c:143:26: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value # 141| if (xid == 0) # 142| goto done; # 143|-> if (sin.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) { # 144| struct in_addr addr = sin.sin_addr; # 145| char buf[INET_ADDRSTRLEN]; Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/sm-notify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/sm-notify.c:725:22: warning[deadcode.DeadStores]: Value stored to 'next' during its initialization is never read # 723| if (host->ai->ai_next != NULL) { # 724| struct addrinfo *first = host->ai; # 725|-> struct addrinfo **next = &host->ai; # 726| # 727| /* remove the first entry from the list */ Error: CPPCHECK_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-479): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c: scope_hint: In function ‘killer’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c:108:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c:108:9: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 106| statd_unregister (); # 107| xlog(D_GENERAL, "Caught signal %d, un-registering and exiting", sig); # 108|-> exit(0); # 109| } # 110| Error: CLANG_WARNING: nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c:175:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 173| if (!fp) # 174| xlog_err("Opening %s failed: %m\n", pidfile); # 175|-> fprintf(fp, "%d\n", getpid()); # 176| pidfd = dup(fileno(fp)); # 177| if (fclose(fp) < 0) { Error: GCC_ANALYZER_WARNING (CWE-688): nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c: scope_hint: In function ‘create_pidfile’ nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c:175:9: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen(pidfile, "w")’ where non-null expected /usr/include/tirpc/rpc/xdr.h:43: included_from: Included from here. /usr/include/tirpc/rpc/rpc.h:43: included_from: Included from here. nfs-utils-2.6.4-build/nfs-utils-2.6.4/utils/statd/statd.c:22: included_from: Included from here. /usr/include/stdio.h:357:12: note: argument 1 of ‘fprintf’ must be non-null # 173| if (!fp) # 174| xlog_err("Opening %s failed: %m\n", pidfile); # 175|-> fprintf(fp, "%d\n", getpid()); # 176| pidfd = dup(fileno(fp)); # 177| if (fclose(fp) < 0) {