ovn-controller-vtep: Fix dereference of NULL pointer.
authorAlex Wang <alexw@nicira.com>
Tue, 18 Aug 2015 06:02:14 +0000 (23:02 -0700)
committerAlex Wang <alexw@nicira.com>
Tue, 18 Aug 2015 16:57:04 +0000 (09:57 -0700)
Found by inspection.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
ovn/controller-vtep/binding.c

index cb7f389..652852d 100644 (file)
@@ -253,6 +253,10 @@ binding_cleanup(struct controller_vtep_ctx *ctx)
         const struct sbrec_chassis *chassis_rec
             = get_chassis_by_name(ctx->ovnsb_idl, pswitch->name);
 
+        if (!chassis_rec) {
+            continue;
+        }
+
         for (;;) {
             port_binding_rec = shash_find_and_delete(&ch_to_pb,
                                                      chassis_rec->name);