libtirpc-1.3.4-1.rc3.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c: scope_hint: In function 'get_server'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c:176:50: warning[-Wanalyzer-malloc-leak]: leak of 'strdup("tcp")'
#  174|   	 */
#  175|   	for (i = 0; (he->h_addr_list[i] != NULL) && (num_ep < maxep);
#  176|-> 						i++, num_ep++) {
#  177|   		struct in_addr *a;
#  178|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c:182:38: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(&hname)'
#  180|   		snprintf(hname, sizeof(hname), "%s.0.111", inet_ntoa(*a));
#  181|   		eps[num_ep].uaddr = strdup(hname);
#  182|-> 		eps[num_ep].family = strdup("inet");
#  183|   		eps[num_ep].proto =  strdup("tcp");
#  184|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c:183:38: warning[-Wanalyzer-malloc-leak]: leak of 'strdup("inet")'
#  181|   		eps[num_ep].uaddr = strdup(hname);
#  182|   		eps[num_ep].family = strdup("inet");
#  183|-> 		eps[num_ep].proto =  strdup("tcp");
#  184|   	}
#  185|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c: scope_hint: In function '__rpc_get_time_offset'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c:284:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*<unknown>.proto' where non-null expected
/usr/include/string.h:462: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/auth_time.c:33: included_from: Included from here.
/usr/include/strings.h:116:12: note: argument 1 of 'strcasecmp' must be non-null
#  282|   		for (i = 0;
#  283|   			(i < epl) && ((udp_ep == -1) || (tcp_ep == -1)); i++) {
#  284|-> 			if (strcasecmp(ep[i].proto, "udp") == 0)
#  285|   				udp_ep = i;
#  286|   			if (strcasecmp(ep[i].proto, "tcp") == 0)

Error: CLANG_WARNING: [#def5]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/bindresvport.c:184:20: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  182|                   }
#  183|   
#  184|->                 af = myaddr.ss_family;
#  185|           } else
#  186|                   af = sa->sa_family;

Error: CLANG_WARNING: [#def6]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_bcast.c:379:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'outbuf_pmap'
#  377|   				goto done_broad;
#  378|   			}
#  379|-> 			pmap_flag = 1;
#  380|   		}
#  381|   #endif				/* PORTMAP */

Error: CLANG_WARNING: [#def7]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_bcast.c:672:15: warning[unix.Malloc]: Potential leak of memory pointed to by field 'tqh_first'
#  670|   		__rpc_freebroadifs(&fdlist[i].nal);
#  671|   	}
#  672|-> 	AUTH_DESTROY(sys_auth);
#  673|   	(void) __rpc_endconf(handle);
#  674|   

Error: CLANG_WARNING: [#def8]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:115:4: warning[deadcode.DeadStores]: Value stored to 'str' is never read
#  113|   		i = strlen(str);
#  114|   		if (i > 0) {
#  115|-> 			str += i;
#  116|   			len -= i;
#  117|   		}

Error: CLANG_WARNING: [#def9]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:116:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  114|   		if (i > 0) {
#  115|   			str += i;
#  116|-> 			len -= i;
#  117|   		}
#  118|   		break;

Error: CLANG_WARNING: [#def10]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:125:4: warning[deadcode.DeadStores]: Value stored to 'str' is never read
#  123|   		i = strlen(str);
#  124|   		if (i > 0) {
#  125|-> 			str += i;
#  126|   			len -= i;
#  127|   		}

Error: CLANG_WARNING: [#def11]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:126:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  124|   		if (i > 0) {
#  125|   			str += i;
#  126|-> 			len -= i;
#  127|   		}
#  128|   		break;

Error: CLANG_WARNING: [#def12]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:147:4: warning[deadcode.DeadStores]: Value stored to 'str' is never read
#  145|   		i = strlen(str);
#  146|   		if (i > 0) {
#  147|-> 			str += i;
#  148|   			len -= i;
#  149|   		}

Error: CLANG_WARNING: [#def13]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:148:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  146|   		if (i > 0) {
#  147|   			str += i;
#  148|-> 			len -= i;
#  149|   		}
#  150|   		break;

Error: CLANG_WARNING: [#def14]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:157:4: warning[deadcode.DeadStores]: Value stored to 'str' is never read
#  155|   		i = strlen(str);
#  156|   		if (i > 0) {
#  157|-> 			str += i;
#  158|   			len -= i;
#  159|   		}

Error: CLANG_WARNING: [#def15]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:158:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  156|   		if (i > 0) {
#  157|   			str += i;
#  158|-> 			len -= i;
#  159|   		}
#  160|   		break;

Error: CLANG_WARNING: [#def16]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:167:4: warning[deadcode.DeadStores]: Value stored to 'str' is never read
#  165|   		i = strlen(str);
#  166|   		if (i > 0) {
#  167|-> 			str += i;
#  168|   			len -= i;
#  169|   		}

Error: CLANG_WARNING: [#def17]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_perror.c:168:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  166|   		if (i > 0) {
#  167|   			str += i;
#  168|-> 			len -= i;
#  169|   		}
#  170|   		break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_simple.c: scope_hint: In function 'rpc_call'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_simple.c:118:46: warning[-Wanalyzer-malloc-leak]: leak of 'rcp'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_simple.c:38: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/clnt_simple.c:120:17: note: in expansion of macro 'thr_setspecific'
#  116|   			rpc_createerr.cf_stat = RPC_SYSTEMERROR;
#  117|   			rpc_createerr.cf_error.re_errno = errno;
#  118|-> 			return (rpc_createerr.cf_stat);
#  119|   		}
#  120|   		thr_setspecific(rpc_call_key, (void *) rcp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c: scope_hint: In function 'endnetconfig'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:139:20: warning[-Wanalyzer-malloc-leak]: leak of '__nc_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:369:9: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:34: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:369:9: note: in expansion of macro 'nc_error'
#  137|   	 * fails.
#  138|   	 */
#  139|-> 	if (nc_key == KEY_INITIALIZER) {
#  140|   		error = 0;
#  141|   		mutex_lock(&nc_lock);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c: scope_hint: In function 'setnetconfig'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:207:5: warning[-Wanalyzer-malloc-leak]: leak of '__nc_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:195:5: note: in expansion of macro 'mutex_lock'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:206:5: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:206:5: note: in expansion of macro 'nc_error'
#  205|       mutex_unlock(&nc_db_lock);
#  206|       nc_error = NC_NONETCONFIG;
#  207|->     free(nc_vars);
#  208|       return (NULL);
#  209|   }

Error: CLANG_WARNING: [#def21]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:390:9: warning[deadcode.DeadStores]: Although the value stored to 'p' is used in the enclosing expression, the value is never actually read from 'p'
#  388|        * Make sure all info in netconfig_info structure has been reinitialized.
#  389|        */
#  390|->     q = p = ni.head;
#  391|       ni.eof = ni.ref = 0;
#  392|       ni.head = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c: scope_hint: In function 'getnetconfigent'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:430:8: warning[-Wanalyzer-malloc-leak]: leak of '__nc_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:429:5: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:429:5: note: in expansion of macro 'nc_error'
#  428|   
#  429|       nc_error = NC_NOTFOUND;	/* default error. */
#  430|->     if (netid == NULL || strlen(netid) == 0) {
#  431|   	return (NULL);
#  432|       }

Error: CLANG_WARNING: [#def23]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:509:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'linep'
#  507|   	free(linep);
#  508|       }
#  509|->     fclose(file);
#  510|       return(ncp);
#  511|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c: scope_hint: In function 'parse_ncp'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:552:13: warning[-Wanalyzer-malloc-leak]: leak of '__nc_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:551:5: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:551:5: note: in expansion of macro 'nc_error'
#  550|   
#  551|       nc_error = NC_BADFILE;	/* nearly anything that breaks is for this reason */
#  552|->     stringp[strlen(stringp)-1] = '\0';	/* get rid of newline */
#  553|       /* netid */
#  554|       if ((ncp->nc_netid = strtok_r(stringp, "\t ", &lasts)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:620:57: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '*ncp.nc_lookups + *ncp.nc_nlookups * 8'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:551:5: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:551:5: note: in expansion of macro 'nc_error'
#  618|   	while ((cp = tokenp) != NULL) {
#  619|   	    tokenp = _get_next_token(cp, ',');
#  620|-> 	    ncp->nc_lookups[(size_t)ncp->nc_nlookups++] = cp;
#  621|   	    ncp->nc_lookups = (char **)realloc(ncp->nc_lookups,
#  622|   		(size_t)(ncp->nc_nlookups+1) *sizeof(char *));	/* for next loop */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:620:57: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '*ncp.nc_lookups'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:551:5: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:551:5: note: in expansion of macro 'nc_error'
#  618|   	while ((cp = tokenp) != NULL) {
#  619|   	    tokenp = _get_next_token(cp, ',');
#  620|-> 	    ncp->nc_lookups[(size_t)ncp->nc_nlookups++] = cp;
#  621|   	    ncp->nc_lookups = (char **)realloc(ncp->nc_lookups,
#  622|   		(size_t)(ncp->nc_nlookups+1) *sizeof(char *));	/* for next loop */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:621:29: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  619|   	    tokenp = _get_next_token(cp, ',');
#  620|   	    ncp->nc_lookups[(size_t)ncp->nc_nlookups++] = cp;
#  621|-> 	    ncp->nc_lookups = (char **)realloc(ncp->nc_lookups,
#  622|   		(size_t)(ncp->nc_nlookups+1) *sizeof(char *));	/* for next loop */
#  623|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c: scope_hint: In function 'nc_sperror'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:637:5: warning[-Wanalyzer-malloc-leak]: leak of '__nc_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:637:12: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:637:12: note: in expansion of macro 'nc_error'
#  635|       const char *message;
#  636|   
#  637|->     switch(nc_error) {
#  638|       case NC_NONETCONFIG:
#  639|   	message = _nc_errors[0];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def29]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetpath.c: scope_hint: In function 'getnetpath'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetpath.c:168:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'chainp'
#  166|   	    chainp = (struct netpath_chain *)	/* cobble alloc chain entry */
#  167|   		    malloc(sizeof (struct netpath_chain));
#  168|-> 	    chainp->ncp = ncp;
#  169|   	    chainp->nchain_next = NULL;
#  170|   	    if (np_sessionp->ncp_list == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetpath.c:173:52: warning[-Wanalyzer-malloc-leak]: leak of 'chainp'
#  171|   		np_sessionp->ncp_list = chainp;
#  172|   	    } else {
#  173|-> 		np_sessionp->ncp_list->nchain_next = chainp;
#  174|   	    }
#  175|   	    return (ncp);

Error: CLANG_WARNING: [#def31]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/key_call.c:295:27: warning[deadcode.DeadStores]: Value stored to 'kcp' during its initialization is never read
#  293|   	struct netconfig *nconf;
#  294|   	struct netconfig *tpconf;
#  295|-> 	struct key_call_private *kcp = key_call_private_main;
#  296|   	struct timeval wait_time;
#  297|   	struct utsname u;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/key_call.c: scope_hint: In function 'getkeyserv_handle'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/key_call.c:315:33: warning[-Wanalyzer-malloc-leak]: leak of 'kcp'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/key_call.c:44: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/key_call.c:317:17: note: in expansion of macro 'thr_setspecific'
#  313|   		kcp = (struct key_call_private *)malloc(sizeof (*kcp));
#  314|   		if (kcp == (struct key_call_private *)NULL) {
#  315|-> 			return ((CLIENT *) NULL);
#  316|   		}
#  317|                   thr_setspecific(key_call_key, (void *) kcp);

Error: CLANG_WARNING: [#def33]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/netnamer.c:99:3: warning[deadcode.DeadStores]: Value stored to 'gidlen' is never read
#   97|   		}
#   98|   		*gidp = (gid_t) atol(p);
#   99|-> 		gidlen = 0;
#  100|   		for (gidlen = 0; gidlen < NGROUPS; gidlen++) {
#  101|   			p = strsep(&res, "\n,");

Error: CLANG_WARNING: [#def34]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/pmap_prot2.c:101:28: warning[core.NullDereference]: Dereference of null pointer (loaded from variable 'rp')
#   99|   
#  100|   	for (;;) {
#  101|-> 		more_elements = (bool_t)(*rp != NULL);
#  102|   		if (! xdr_bool(xdrs, &more_elements))
#  103|   			return (FALSE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_generic.c:273:17: warning[-Wanalyzer-malloc-leak]: leak of 'netid_tcp'
#  271|   	if (strcmp(nettype, "udp") == 0)
#  272|   		netid = netid_udp;
#  273|-> 	else if (strcmp(nettype, "tcp") == 0)
#  274|   		netid = netid_tcp;
#  275|   	else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_generic.c: scope_hint: In function '__rpc_getconfip'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_generic.c:273:17: warning[-Wanalyzer-malloc-leak]: leak of 'netid_udp'
#  271|   	if (strcmp(nettype, "udp") == 0)
#  272|   		netid = netid_udp;
#  273|-> 	else if (strcmp(nettype, "tcp") == 0)
#  274|   		netid = netid_tcp;
#  275|   	else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_generic.c:278:12: warning[-Wanalyzer-malloc-leak]: leak of 'netid_tcp'
#  276|   		return (NULL);
#  277|   	}
#  278|-> 	if ((netid == NULL) || (netid[0] == 0)) {
#  279|   		return (NULL);
#  280|   	}

Error: CLANG_WARNING: [#def38]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_generic.c:483:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value
#  481|   
#  482|   	/* XXX */
#  483|-> 	if (ss.ss_family != AF_LOCAL) {
#  484|   		if (type == SOCK_STREAM)
#  485|   			proto = IPPROTO_TCP;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mech_info'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:54:20: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mech_info'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:31: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mech_info'
#   52|   	rpc_gss_error_t *result;
#   53|   
#   54|-> 	if (rg_key == KEY_INITIALIZER) {
#   55|   		static mutex_t _rpc_gss_error_lock = MUTEX_INITIALIZER;
#   56|   		int err = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_set_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:109:1: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:31: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
#  107|   	error->rpc_gss_error = RPC_GSS_ER_SYSTEMERROR;
#  108|   	error->system_error = system_error;
#  109|-> }
#  110|   
#  111|   /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_clear_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:121:1: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
#  119|   	error->rpc_gss_error = RPC_GSS_ER_SUCCESS;
#  120|   	error->system_error = 0;
#  121|-> }
#  122|   
#  123|   /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mechanisms'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:251:16: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mechanisms'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mechanisms'
#  249|   {
#  250|   	rpc_gss_clear_error();
#  251|-> 	return (char **)_rpc_gss_mechanism_names;
#  252|   }
#  253|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mech_info'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:281:16: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mech_info'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_mech_info'
#  279|   
#  280|   	rpc_gss_clear_error();
#  281|-> 	*dummy = rpcsec_gss_svc_privacy;
#  282|   	return (char **)m->mi_qop_names;
#  283|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_versions'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:302:22: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_versions'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_get_versions'
#  300|   
#  301|   	rpc_gss_clear_error();
#  302|-> 	*high = *low = RPCSEC_GSS_VERSION;
#  303|   	return TRUE;
#  304|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_is_installed'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:325:13: warning[-Wanalyzer-malloc-leak]: leak of '__rpc_gss_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_is_installed'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c:73:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_gss_utils.c: scope_hint: In function 'rpc_gss_is_installed'
#  323|   
#  324|   	rpc_gss_clear_error();
#  325|-> 	m = _rpc_gss_find_mechanism(mechanism);
#  326|   	if (m == NULL)
#  327|   		return FALSE;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_soc.c: scope_hint: In function 'svcunix_create'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpc_soc.c:704:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor '__rpc_nconf2fd(<unknown>)'
#  702|   	sun.sun_family = AF_LOCAL;
#  703|   	strncpy(sun.sun_path, path, (sizeof(sun.sun_path)-1));
#  704|-> 	if (sun.sun_path[0] == '@')
#  705|   		/* abstract address */
#  706|   		sun.sun_path[0] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_clnt.c: scope_hint: In function 'delete_cache'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_clnt.c:264:65: warning[-Wanalyzer-null-dereference]: dereference of NULL 'addr'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_clnt.c:57: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_clnt.c:244:25: note: in expansion of macro 'LIBTIRPC_DEBUG'
#  262|   
#  263|   	for (cptr = front; cptr != NULL; cptr = cptr->ac_next) {
#  264|-> 		if (!memcmp(cptr->ac_taddr->buf, addr->buf, addr->len)) {
#  265|   			/* Unlink from cache. We'll destroy it after releasing the mutex. */
#  266|   			if (cptr->ac_uaddr) {

Error: CLANG_WARNING: [#def48]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_clnt.c:911:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '!=' is a garbage value
#  909|   	}
#  910|   
#  911|-> 	if (parms.r_addr != NULL && parms.r_addr != nullstring)
#  912|   		free(parms.r_addr);
#  913|   

Error: CLANG_WARNING: [#def49]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_prot.c:122:11: warning[core.NullDereference]: Access to field 'rpcb_next' results in a dereference of a null pointer
#  120|   		 */
#  121|   		if (freeing)
#  122|-> 			next = (*rp)->rpcb_next;
#  123|   		if (! xdr_reference(xdrs, (caddr_t *)rp,
#  124|   		    (u_int)sizeof (rpcblist), (xdrproc_t)xdr_rpcb)) {

Error: CLANG_WARNING: [#def50]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/rpcb_prot.c:211:11: warning[core.NullDereference]: Access to field 'rpcb_entry_next' results in a dereference of a null pointer
#  209|   		 */
#  210|   		if (freeing)
#  211|-> 			next = (*rp)->rpcb_entry_next;
#  212|   		if (! xdr_reference(xdrs, (caddr_t *)rp,
#  213|   		    (u_int)sizeof (rpcb_entry_list),

Error: CLANG_WARNING: [#def51]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_auth_gss.c:650:6: warning[unix.Malloc]: Use of memory after it is freed
#  648|   
#  649|   	/* Check sequence number. */
#  650|-> 	if (gd->established) {
#  651|   		if (gc->gc_seq > MAXSEQ) {
#  652|   			result = RPCSEC_GSS_CTXPROBLEM;

Error: CLANG_WARNING: [#def52]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_auth_gss.c:706:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'gr.gr_ctx.value'
#  704|   
#  705|   		if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win))) {
#  706|-> 			result = AUTH_FAILED;
#  707|   			break;
#  708|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def53]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c: scope_hint: In function 'cache_set'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:579:16: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'calloc(1, (long unsigned int)*xprt.xp_rtaddr.len)' where non-null expected
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:385:18: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:539:26: note: in expansion of macro 'ALLOC'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:545:26: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:385:18: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:578:34: note: in expansion of macro 'ALLOC'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  577|   	victim->cache_addr = xprt->xp_rtaddr;
#  578|   	victim->cache_addr.buf = ALLOC(char, xprt->xp_rtaddr.len);
#  579|-> 	(void) memcpy(victim->cache_addr.buf, xprt->xp_rtaddr.buf,
#  580|   	    (size_t)xprt->xp_rtaddr.len);
#  581|   	loc = CACHE_LOC(xprt, victim->cache_xid);

Error: CLANG_WARNING: [#def54]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_run.c:97:3: warning[unix.Malloc]: Attempt to free released memory
#   95|       }
#   96|   
#   97|->   free (my_pollfd);
#   98|   }
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/xdr_rec.c: scope_hint: In function 'realloc_stream'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/xdr_rec.c:788:32: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/xdr_rec.c:50: included_from: Included from here.
#  786|   		rstrm->in_boundry = buf + size;
#  787|   		rstrm->recvsize = size;
#  788|-> 		rstrm->in_size = size;
#  789|   	}
#  790|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libtirpc-1.3.4-build/libtirpc-1.3.4/tirpc/reentrant.h:57:33: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:488:9: note: in expansion of macro 'mutex_unlock'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:385:18: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:462:14: note: in expansion of macro 'ALLOC'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:385:18: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:470:26: note: in expansion of macro 'ALLOC'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:477:9: note: in expansion of macro 'MEMZERO'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:486:9: note: in expansion of macro 'MEMZERO'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:488:9: note: in expansion of macro 'mutex_unlock'
#   55|   #define mutex_init(m, a)	pthread_mutex_init(m, a)
#   56|   #define mutex_lock(m)		pthread_mutex_lock(m)
#   57|-> #define mutex_unlock(m)		pthread_mutex_unlock(m)
#   58|   
#   59|   #define cond_init(c, a, p)	pthread_cond_init(c, a)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c: scope_hint: In function 'getnetconfig'
libtirpc-1.3.4-build/libtirpc-1.3.4/tirpc/reentrant.h:57:33: warning[-Wanalyzer-malloc-leak]: leak of '__nc_error()'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:236:9: note: in expansion of macro 'mutex_unlock'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:235:9: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:151:21: note: in expansion of macro 'thr_setspecific'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:235:9: note: in expansion of macro 'nc_error'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/getnetconfig.c:236:9: note: in expansion of macro 'mutex_unlock'
#   55|   #define mutex_init(m, a)	pthread_mutex_init(m, a)
#   56|   #define mutex_lock(m)		pthread_mutex_lock(m)
#   57|-> #define mutex_unlock(m)		pthread_mutex_unlock(m)
#   58|   
#   59|   #define cond_init(c, a, p)	pthread_cond_init(c, a)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:41: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c: scope_hint: In function 'svc_dg_enablecache'
libtirpc-1.3.4-build/libtirpc-1.3.4/tirpc/reentrant.h:57:33: warning[-Wanalyzer-malloc-leak]: leak of 'uc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:488:9: note: in expansion of macro 'mutex_unlock'
libtirpc-1.3.4-build/libtirpc-1.3.4/tirpc/rpc/rpc.h:38: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:44: included_from: Included from here.
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:385:18: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:462:14: note: in expansion of macro 'ALLOC'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:385:18: note: in expansion of macro 'mem_alloc'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:462:14: note: in expansion of macro 'ALLOC'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:477:9: note: in expansion of macro 'MEMZERO'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:486:9: note: in expansion of macro 'MEMZERO'
libtirpc-1.3.4-build/libtirpc-1.3.4/src/svc_dg.c:488:9: note: in expansion of macro 'mutex_unlock'
#   55|   #define mutex_init(m, a)	pthread_mutex_init(m, a)
#   56|   #define mutex_lock(m)		pthread_mutex_lock(m)
#   57|-> #define mutex_unlock(m)		pthread_mutex_unlock(m)
#   58|   
#   59|   #define cond_init(c, a, p)	pthread_cond_init(c, a)

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-7.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibtirpc-1.3.4-1.rc3.fc41
store-results-to/tmp/tmpcisokyq0/libtirpc-1.3.4-1.rc3.fc41.tar.xz
time-created2024-07-03 16:00:49
time-finished2024-07-03 16:02:35
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpcisokyq0/libtirpc-1.3.4-1.rc3.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpcisokyq0/libtirpc-1.3.4-1.rc3.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9