meta-flow: Don't dereference NULL sf->field in mf_format_subfield().
authorBen Pfaff <blp@nicira.com>
Thu, 15 Mar 2012 21:06:54 +0000 (14:06 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 15 Mar 2012 21:12:23 +0000 (14:12 -0700)
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c

index c12a9097744ac2af67d615773d8812bb1bdc3e96..11d27b1597d3973b04611bdc02600dfc1209bea7 100644 (file)
@@ -2343,7 +2343,7 @@ mf_format_subfield(const struct mf_subfield *sf, struct ds *s)
         ds_put_cstr(s, sf->field->name);
     }
 
-    if (sf->ofs == 0 && sf->n_bits == sf->field->n_bits) {
+    if (sf->field && sf->ofs == 0 && sf->n_bits == sf->field->n_bits) {
         ds_put_cstr(s, "[]");
     } else if (sf->n_bits == 1) {
         ds_put_format(s, "[%d]", sf->ofs);