Task #119258 - fixed.err

back to task #119258
download
Error: COMPILER_WARNING (CWE-126):
nfs-utils-2.8.7/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.8.7/support/nfs/getport.c: scope_hint: In function 'main'
nfs-utils-2.8.7/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.8.7/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.8.7/support/nsm/rpc.c: scope_hint: In function 'nsm_xmit_getaddr.constprop'
nfs-utils-2.8.7/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: GCC_ANALYZER_WARNING (CWE-122):
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:420:33: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:407:12: branch_false: following 'false' branch...
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:409:13: branch_false: ...to here
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:409:12: branch_true: following 'true' branch...
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:415:25: branch_true: ...to here
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:415:25: branch_false: following 'false' branch (when 'r' is NULL)...
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:418:31: branch_false: ...to here
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:419:28: branch_true: following 'true' branch (when 'buf' is non-NULL)...
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:420:33: branch_true: ...to here
nfs-utils-2.8.7/support/nfsidmap/libnfsidmap.c:420:33: danger: out-of-bounds write at byte 0 but region ends at byte 0
#  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: COMPILER_WARNING (CWE-563):
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c: scope_hint: In function ‘netlink_msg_alloc’
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c:444:13: warning[-Wunused-variable]: unused variable ‘id’
#  444 |         int id;
#      |             ^~
#  442|   {
#  443|   	struct nl_msg *msg;
#  444|-> 	int id;
#  445|   
#  446|   	msg = nlmsg_alloc();

Error: COMPILER_WARNING (CWE-252):
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c: scope_hint: In function ‘lockd_nl_family_setup’
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c:477:25: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  477 |                         system("modprobe lockd");
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
#  475|   		lockd_nl_family = resolve_family(sock, LOCKD_FAMILY_NAME, L_WARNING);
#  476|   		if (lockd_nl_family) {
#  477|-> 			system("modprobe lockd");
#  478|   			lockd_nl_family = resolve_family(sock, LOCKD_FAMILY_NAME, L_ERROR);
#  479|   		}

Error: COMPILER_WARNING (CWE-252):
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c: scope_hint: In function ‘nfsd_nl_family_setup’
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c:489:25: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  489 |                         system("modprobe nfsd");
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~
#  487|   		nfsd_nl_family = resolve_family(sock, NFSD_FAMILY_NAME, L_WARNING);
#  488|   		if (!nfsd_nl_family) {
#  489|-> 			system("modprobe nfsd");
#  490|   			nfsd_nl_family = resolve_family(sock, NFSD_FAMILY_NAME, L_ERROR);
#  491|   		}

Error: COMPILER_WARNING (CWE-563):
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c: scope_hint: In function ‘getpolicy_handler’
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c:504:27: warning[-Wunused-variable]: unused variable ‘index’
#  504 |                 int i, j, index;
#      |                           ^~~~~
#  502|   	nla_for_each_attr(attr, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), rem) {
#  503|   		struct nlattr *a, *b;
#  504|-> 		int i, j, index;
#  505|   
#  506|   		if (nla_type(attr) == CTRL_ATTR_POLICY) {

Error: COMPILER_WARNING (CWE-563):
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c:526:13: warning[-Wunused-variable]: unused variable ‘opt’
#  526 |         int opt, ret, id;
#      |             ^~~
#  524|   	struct nl_msg *msg;
#  525|   	struct nl_cb *cb;
#  526|-> 	int opt, ret, id;
#  527|   
#  528|   	if (!nfsd_nl_family_setup(sock))

Error: COMPILER_WARNING (CWE-563):
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c: scope_hint: In function ‘query_nfsd_nl_policy’
nfs-utils-2.8.7/utils/nfsdctl/nfsdctl.c:526:23: warning[-Wunused-variable]: unused variable ‘id’
#  526 |         int opt, ret, id;
#      |                       ^~
#  524|   	struct nl_msg *msg;
#  525|   	struct nl_cb *cb;
#  526|-> 	int opt, ret, id;
#  527|   
#  528|   	if (!nfsd_nl_family_setup(sock))