ofproto-dpif: Fix null pointer dereference in is_admissible().
authorBen Pfaff <blp@nicira.com>
Tue, 17 May 2011 20:41:32 +0000 (13:41 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 17 May 2011 20:41:32 +0000 (13:41 -0700)
If in_port is NULL then we must not dereference it.

ofproto/ofproto-dpif.c

index b7194930d0a0e17bbf98605706f7a1b363dec053..82bb0e0c2b4c597461914becbc216ebaaef64886 100644 (file)
@@ -3526,7 +3526,7 @@ is_admissible(struct ofproto_dpif *ofproto, const struct flow *flow,
 
     /* Find the port and bundle for the received packet. */
     in_port = get_ofp_port(ofproto, flow->in_port);
-    *in_bundlep = in_bundle = in_port->bundle;
+    *in_bundlep = in_bundle = in_port ? in_port->bundle : NULL;
     if (!in_port || !in_bundle) {
         /* No interface?  Something fishy... */
         if (have_packet) {