Skip to content

Commit

Permalink
ofproto: Fix potential NULL dereference in ofproto_get_datapath_cap().
Browse files Browse the repository at this point in the history
Reproducer:
  ovs-vsctl \
    -- add-br br \
    -- set bridge br datapath-type=foo \
    -- --id=@m create Datapath datapath_version=0 'capabilities={}' \
    -- set Open_vSwitch . datapaths:"foo"=@m

Fixes: 2750180 ("ofproto-dpif: Expose datapath capability to ovsdb.")
Signed-off-by: Dumitru Ceara <[email protected]>
Acked-by: Paolo Valerio <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
dceara authored and igsilya committed Jun 3, 2021
1 parent f1951d4 commit dd0f597
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/ofproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ ofproto_get_datapath_cap(const char *datapath_type, struct smap *dp_cap)
datapath_type = ofproto_normalize_type(datapath_type);
const struct ofproto_class *class = ofproto_class_find__(datapath_type);

if (class->get_datapath_cap) {
if (class && class->get_datapath_cap) {
class->get_datapath_cap(datapath_type, dp_cap);
}
}
Expand Down

0 comments on commit dd0f597

Please sign in to comment.