summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-08-10 02:39:55 +0530
committerAmar Tumballi <amarts@redhat.com>2018-08-17 03:06:41 +0000
commit1909f2ca01efcd467164a2d7ed684cdc6e1437de (patch)
tree23b13d0187d9adb92b1a40628247a5a77def938d /xlators
parentdb16111e9f948069fc89d6653b6bd92f31808e65 (diff)
nfs-server-mount : fix coverity issues in mount3.c
Fixes CID 1389033, 1388767, 1288782. Change-Id: I244f88b2ca8487f8926da45d886982558ad45c7a updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/nfs/server/src/mount3.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 472915fb067..ad52c6b7817 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -1757,11 +1757,11 @@ mnt3_check_client_net_udp (struct svc_req *req, char *volname, xlator_t *nfsx)
* address family. Sigh.
*/
#endif
- /* And let's make sure that it's actually an IPv4 address. */
- GF_ASSERT (sin->sin_family == AF_INET);
-
if (!sin)
goto err;
+ /* And let's make sure that it's actually an IPv4 address. */
+
+ GF_ASSERT (sin->sin_family == AF_INET);
(void) inet_ntop (AF_INET, &sin->sin_addr, ipaddr, INET_ADDRSTRLEN);
@@ -1997,9 +1997,13 @@ _mnt3_authenticate_req (struct mount3_state *ms, rpcsvc_request_t *req,
GF_VALIDATE_OR_GOTO (GF_MNT, req, out);
peer_addr = _mnt3_get_peer_addr (req);
+
+ if (!peer_addr)
+ goto free_and_out;
+
host_addr_ip = _mnt3_get_host_from_peer (peer_addr);
- if (!host_addr_ip || !peer_addr)
+ if (!host_addr_ip)
goto free_and_out;
if (path) {
@@ -2713,7 +2717,7 @@ mnt3_xlchildren_to_exports (rpcsvc_t *svc, struct mount3_state *ms)
/* chain the groups together */
if (!elist->ex_groups)
elist->ex_groups = group;
- else
+ else if (!prev_group)
prev_group->gr_next = group;
prev_group = group;
}