rx: protect against invalid params in rx_Copy*RPCStats
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 25 Jul 2012 05:55:27 +0000 (01:55 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 27 Jul 2012 13:34:44 +0000 (06:34 -0700)
Protect against:

  . rxi_Alloc() failure

Change-Id: I3334855e261bb40d5720fd376e62028760f0cee5
Reviewed-on: http://gerrit.openafs.org/7873
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/rx/rx.c

index f4af618..4689bea 100644 (file)
@@ -8232,6 +8232,9 @@ rx_CopyProcessRPCStats(afs_uint64 op)
     if (rxInterface == -1)
         return NULL;
 
+    if (rpcop_stat == NULL)
+        return NULL;
+
     MUTEX_ENTER(&rx_rpc_stats);
     rpc_stat = rxi_FindRpcStat(&processStats, rxInterface, 0, 0,
                               0, 0, 0, 0, 0);
@@ -8262,6 +8265,9 @@ rx_CopyPeerRPCStats(afs_uint64 op, afs_uint32 peerHost, afs_uint16 peerPort)
     if (rxInterface == -1)
         return NULL;
 
+    if (rpcop_stat == NULL)
+        return NULL;
+
     peer = rxi_FindPeer(peerHost, peerPort, 0, 0);
     if (!peer)
         return NULL;