rpcbind-1.2.6-4.rc3.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/check_bound.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/pmap_svc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_stat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def4]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def5]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_4.c:411:26: warning[core.NullDereference]: Access to field 'rpcb_entry_next' results in a dereference of a null pointer (loaded from variable 'tail')
#  409|   			tail = rp;
#  410|   		} else {
#  411|-> 			tail->rpcb_entry_next = rp;
#  412|   			tail = rp;
#  413|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_4.c: scope_hint: In function ‘rpcbproc_getaddrlist_4_local’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_4.c:411:47: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tail’
#  409|   			tail = rp;
#  410|   		} else {
#  411|-> 			tail->rpcb_entry_next = rp;
#  412|   			tail = rp;
#  413|   		}

Error: CPPCHECK_WARNING: [#def7]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c: scope_hint: In function ‘forward_register’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c:964:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#  962|   	rpcb_rmtcalls++;	/* no of pending calls */
#  963|   	FINFO[j].flag = FINFO_ACTIVE;
#  964|-> 	FINFO[j].reply_type = reply_type;
#  965|   	FINFO[j].versnum = versnum;
#  966|   	FINFO[j].time = time_now;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c: scope_hint: In function ‘handle_reply’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c:1254:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘reply_msg.rm_xid’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c: scope_hint: In function ‘handle_reply’
# 1252|   		free(buffer);
# 1253|   
# 1254|-> 	if (reply_msg.rm_xid == 0) {
# 1255|   #ifdef	SVC_RUN_DEBUG
# 1256|   	if (debugging) {

Error: COMPILER_WARNING (CWE-457): [#def10]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c: scope_hint: In function ‘handle_reply’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c:1254:22: warning[-Wmaybe-uninitialized]: ‘reply_msg.rm_xid’ may be used uninitialized
# 1254 |         if (reply_msg.rm_xid == 0) {
#      |             ~~~~~~~~~^~~~~~~
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c:1177:25: note: ‘reply_msg’ declared here
# 1177 |         struct rpc_msg  reply_msg;
#      |                         ^~~~~~~~~
# 1252|   		free(buffer);
# 1253|   
# 1254|-> 	if (reply_msg.rm_xid == 0) {
# 1255|   #ifdef	SVC_RUN_DEBUG
# 1256|   	if (debugging) {

Error: CLANG_WARNING: [#def11]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcb_svc_com.c:1254:23: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
# 1252|   		free(buffer);
# 1253|   
# 1254|-> 	if (reply_msg.rm_xid == 0) {
# 1255|   #ifdef	SVC_RUN_DEBUG
# 1256|   	if (debugging) {

Error: CPPCHECK_WARNING: [#def12]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def13]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:164:4: warning[deadcode.DeadStores]: Value stored to 'once' is never read
#  162|   	    O_RDONLY|O_CREAT, 0444))) == -1) {
#  163|   		if (once) {
#  164|-> 			once = system(systemdtmp); /* set once to avoid a warning */
#  165|   			once = 0;
#  166|   			goto tryagain; 

Error: CLANG_WARNING: [#def14]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:427:23: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  425|   		}
#  426|   
#  427|-> 		if (sa.sa.sa_family == AF_INET6 && handle_ipv6_socket(fd))
#  428|   		        goto error;
#  429|   

Error: CPPCHECK_WARNING (CWE-401): [#def15]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:483: error[memleakOnRealloc]: Common realloc mistake: 'hosts' nulled but not freed upon failure
#  481|   		nhostsbak = nhosts;
#  482|   		nhostsbak++;
#  483|-> 		hosts = realloc(hosts, nhostsbak * sizeof(char *));
#  484|   		if (nhostsbak == 1)
#  485|   			hosts[0] = "*";

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c: scope_hint: In function ‘init_transport’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:485:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  483|   		hosts = realloc(hosts, nhostsbak * sizeof(char *));
#  484|   		if (nhostsbak == 1)
#  485|-> 			hosts[0] = "*";
#  486|   		else {
#  487|   			if (hints.ai_family == AF_INET) {

Error: CLANG_WARNING: [#def17]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:487:24: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  485|   			hosts[0] = "*";
#  486|   		else {
#  487|-> 			if (hints.ai_family == AF_INET) {
#  488|   				hosts[nhostsbak - 1] = "127.0.0.1";
#  489|   			} else if (hints.ai_family == AF_INET6) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def18]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:487:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘hints.ai_family’
#  485|   			hosts[0] = "*";
#  486|   		else {
#  487|-> 			if (hints.ai_family == AF_INET) {
#  488|   				hosts[nhostsbak - 1] = "127.0.0.1";
#  489|   			} else if (hints.ai_family == AF_INET6) {

Error: CLANG_WARNING: [#def19]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:510:19: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
#  508|   			}
#  509|   
#  510|-> 			hints.ai_flags &= ~AI_NUMERICHOST;
#  511|   			switch (hints.ai_family) {
#  512|   			case AF_INET:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def20]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:510:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘hints.ai_flags’
#  508|   			}
#  509|   
#  510|-> 			hints.ai_flags &= ~AI_NUMERICHOST;
#  511|   			switch (hints.ai_family) {
#  512|   			case AF_INET:

Error: CLANG_WARNING: [#def21]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:548:9: warning[deadcode.DeadStores]: Although the value stored to 'aicode' is used in the enclosing expression, the value is never actually read from 'aicode'
#  546|   				hosts[nhostsbak] = NULL;
#  547|   
#  548|-> 			if ((aicode = getaddrinfo(hosts[nhostsbak],
#  549|   			    servname, &hints, &res)) != 0) {
#  550|   			  if ((aicode = getaddrinfo(hosts[nhostsbak],

Error: CLANG_WARNING: [#def22]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:631:9: warning[deadcode.DeadStores]: Although the value stored to 'aicode' is used in the enclosing expression, the value is never actually read from 'aicode'
#  629|   		if ((strcmp(nconf->nc_netid, "local") != 0) &&
#  630|   		    (strcmp(nconf->nc_netid, "unix") != 0)) {
#  631|-> 			if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
#  632|   			  if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
#  633|   			  printf("cannot get local address for %s: %s",  nconf->nc_netid, gai_strerror(aicode));

Error: CLANG_WARNING: [#def23]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:671:3: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  669|   			return 1;
#  670|   		}
#  671|-> 		memcpy(taddr.addr.buf, sa, addrlen);
#  672|   #ifdef RPCBIND_DEBUG
#  673|   		if (debugging) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def24]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcbind.c:671:17: warning[-Wanalyzer-null-argument]: use of NULL ‘sa’ where non-null expected
<built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null
#  669|   			return 1;
#  670|   		}
#  671|-> 		memcpy(taddr.addr.buf, sa, addrlen);
#  672|   #ifdef RPCBIND_DEBUG
#  673|   		if (debugging) {

Error: CPPCHECK_WARNING: [#def25]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def26]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:469:7: warning[deadcode.DeadStores]: Value stored to 'rpc_stat' is never read
#  467|     for (vers = minvers; vers <= maxvers; vers++)
#  468|       {
#  469|->       rpc_stat = ip_ping_one(client, vers);
#  470|         if (pstatus (client, prognum, vers) < 0)
#  471|   	failure = 1;

Error: CLANG_WARNING: [#def27]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:975:26: warning[unix.Malloc]: Potential leak of memory pointed to by 'rs'
#  973|         printf
#  974|   	("   program version(s) netid(s)                         service     owner\n");
#  975|->       for (rs = rs_head; rs; rs = rs->next)
#  976|   	{
#  977|   	  size_t netidmax = sizeof(buf) - 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:1016:3: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:841:11: note: in expansion of macro ‘CLNT_GETERR’
# 1014|       }
# 1015|     clnt_destroy (client);
# 1016|->   return;
# 1017|   error:fprintf (stderr, "rpcinfo: no memory\n");
# 1018|     return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c: scope_hint: In function ‘rpcbdump’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:1016:3: warning[-Wanalyzer-malloc-leak]: leak of ‘prev’
/usr/include/tirpc/rpc/rpc.h:49: included_from: Included from here.
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:52: included_from: Included from here.
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:841:11: note: in expansion of macro ‘CLNT_GETERR’
# 1014|       }
# 1015|     clnt_destroy (client);
# 1016|->   return;
# 1017|   error:fprintf (stderr, "rpcinfo: no memory\n");
# 1018|     return;

Error: CLANG_WARNING: [#def30]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:1017:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'head'
# 1015|     clnt_destroy (client);
# 1016|     return;
# 1017|-> error:fprintf (stderr, "rpcinfo: no memory\n");
# 1018|     return;
# 1019|   }

Error: CLANG_WARNING: [#def31]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:1017:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'prev'
# 1015|     clnt_destroy (client);
# 1016|     return;
# 1017|-> error:fprintf (stderr, "rpcinfo: no memory\n");
# 1018|     return;
# 1019|   }

Error: CLANG_WARNING: [#def32]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:1566:7: warning[deadcode.DeadStores]: Value stored to 'rpc_stat' is never read
# 1564|       {
# 1565|         client = clnt_addr_create (address, nconf, prognum, versnum);
# 1566|->       rpc_stat = CLNT_CALL (client, NULLPROC, (xdrproc_t) xdr_void,
# 1567|   			    (char *) NULL, (xdrproc_t) xdr_void,
# 1568|   			    (char *) NULL, to);

Error: CLANG_WARNING: [#def33]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/rpcinfo.c:1700:7: warning[deadcode.DeadStores]: Value stored to 'rpc_stat' is never read
# 1698|       {
# 1699|         (void) CLNT_CONTROL (client, CLSET_VERS, (char *) &versnum);
# 1700|->       rpc_stat = CLNT_CALL (client, NULLPROC, (xdrproc_t) xdr_void,
# 1701|   			    (char *) NULL, (xdrproc_t) xdr_void,
# 1702|   			    (char *) NULL, to);

Error: CPPCHECK_WARNING: [#def34]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def35]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/util.c:326:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  324|   				fprintf(stderr, "can't alloc local ip4 addr\n");
#  325|   		}
#  326|-> 		memcpy(local_in4, res->ai_addr, sizeof *local_in4);
#  327|   	}
#  328|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def36]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/util.c: scope_hint: In function ‘network_init’
rpcbind-1.2.6-build/rpcbind-1.2.6/src/util.c:326:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘local_in4’
#  324|   				fprintf(stderr, "can't alloc local ip4 addr\n");
#  325|   		}
#  326|-> 		memcpy(local_in4, res->ai_addr, sizeof *local_in4);
#  327|   	}
#  328|   

Error: CLANG_WARNING: [#def37]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/util.c:341:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  339|   				fprintf(stderr, "can't alloc local ip6 addr\n");
#  340|   		}
#  341|-> 		memcpy(local_in6, res->ai_addr, sizeof *local_in6);
#  342|   	}
#  343|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def38]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/util.c:341:17: warning[-Wanalyzer-null-argument]: use of NULL ‘local_in6’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  339|   				fprintf(stderr, "can't alloc local ip6 addr\n");
#  340|   		}
#  341|-> 		memcpy(local_in6, res->ai_addr, sizeof *local_in6);
#  342|   	}
#  343|   

Error: CPPCHECK_WARNING: [#def39]
rpcbind-1.2.6-build/rpcbind-1.2.6/src/xlog.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-93.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namerpcbind-1.2.6-4.rc3.fc41
store-results-to/tmp/tmp1qrmnjov/rpcbind-1.2.6-4.rc3.fc41.tar.xz
time-created2024-07-03 17:49:07
time-finished2024-07-03 17:50:16
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp1qrmnjov/rpcbind-1.2.6-4.rc3.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp1qrmnjov/rpcbind-1.2.6-4.rc3.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9