Skip to content

Commit

Permalink
ofproto: Fix potential null-ptr dereference in meter_insert_rule().
Browse files Browse the repository at this point in the history
Add an ovs_assert() in  this case, as a valid meter should exists.

Signed-off-by: Eelco Chaudron <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
chaudron authored and ovsrobot committed Feb 6, 2025
1 parent 8494524 commit 0f8e5c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ofproto/ofproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -6948,6 +6948,7 @@ meter_insert_rule(struct rule *rule)
uint32_t meter_id = ofpacts_get_meter(a->ofpacts, a->ofpacts_len);
struct meter *meter = ofproto_get_meter(rule->ofproto, meter_id);

ovs_assert(meter);
ovs_list_insert(&meter->rules, &rule->meter_list_node);
}

Expand Down

0 comments on commit 0f8e5c2

Please sign in to comment.