Covscan Scan: Wrong Check of Return Value
Subsystems (2)
PATCH 1/2 Covscan Scan: Wrong Check of Return Value
Signed-off-by Steve Dickson <[email protected]>
--- support/export/client.c | 3 +++ 1 file changed, 3 insertions(+)
support/export/client.c +3 -0
@@ -699,6 +699,9 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)/* check whether the IP itself is in the netgroup */ ip =calloc (INET6_ADDRSTRLEN ,1 ); +if (ip ==NULL ) + goto out; +if (inet_ntop (ai->ai_family, &(((struct sockaddr_in *)ai->ai_addr)->sin_addr), ip,INET6_ADDRSTRLEN ) == ip) {if (innetgr (netgroup, ip,NULL ,NULL )) {free (hname);
Signature · 1 line
2.38.1
PATCH 2/2 Covscan Scan: Fixed a couple CLANG_WARNINGs
Signed-off-by Steve Dickson <[email protected]>
--- tools/nfsrahead/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/nfsrahead/main.c +1 -1
@@ -167,7 +167,7 @@ int main(int argc, char **argv)if ((ret =get_device_info (argv[optind], &device)) ==0 )break ; -if (ret !=0 ) { +if (ret !=0 || device.fstype ==NULL ) {xlog (D_GENERAL ,"unable to find device %s\n" , argv[optind]); goto out; }
Signature · 1 line
2.38.1
Re: [PATCH 2/2] Covscan Scan: Fixed a couple CLANG_WARNINGs
Quoted 2 lines · Steve Dickson
Committed... (tag: nfs-utils-2-6-3-rc6)
steved.
Quoted 17 lines
--- tools/nfsrahead/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/nfsrahead/main.c +1
-1@@ -167,7 +167,7 @@ int main(int argc, char **argv)if ((ret =get_device_info (argv[optind], &device)) ==0 )break ; -if (ret !=0 ) { +if (ret !=0 || device.fstype ==NULL ) {xlog (D_GENERAL ,"unable to find device %s\n" , argv[optind]); goto out; }
Quoted 2 lines · Steve Dickson
Committed... (tag: nfs-utils-2-6-3-rc6)
steved.
Quoted 18 lines
--- support/export/client.c | 3 +++ 1 file changed, 3 insertions(+)support/export/client.c +3
-0@@ -699,6 +699,9 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)/* check whether the IP itself is in the netgroup */ ip =calloc (INET6_ADDRSTRLEN ,1 ); +if (ip ==NULL ) + goto out; +if (inet_ntop (ai->ai_family, &(((struct sockaddr_in *)ai->ai_addr)->sin_addr), ip,INET6_ADDRSTRLEN ) == ip) {if (innetgr (netgroup, ip,NULL ,NULL )) {free (hname);