rx: fix abort on missing service
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 20 Jul 2012 14:20:02 +0000 (10:20 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 21 Jul 2012 23:37:50 +0000 (16:37 -0700)
patchset 1fbe83f9aacfc36a9c426ba1fd18ad7c72869dc1 introduced
the possibility that a NULL connection pointer could be dereferenced.
Prevent it.

Change-Id: Ic813642c8073cedc3e4df578c1b06fecd22cfbdf
Reviewed-on: http://gerrit.openafs.org/7794
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/rx/rx.c

index 0fdeb5a..79956d4 100644 (file)
@@ -3246,10 +3246,11 @@ rxi_ReceivePacket(struct rx_packet *np, osi_socket socket,
 
     /* To avoid having 2 connections just abort at each other,
        don't abort an abort. */
-    if (!conn && (np->header.type != RX_PACKET_TYPE_ABORT)) {
-       rxi_SendRawAbort(socket, host, port, RX_INVALID_OPERATION,
-                        np, 0);
-       return np;
+    if (!conn) {
+        if (np->header.type != RX_PACKET_TYPE_ABORT)
+            rxi_SendRawAbort(socket, host, port, RX_INVALID_OPERATION,
+                             np, 0);
+        return np;
     }
 
     /* If we're doing statistics, then account for the incoming packet */