Skip to content

Commit

Permalink
ofp-actions: Assert variable actions have len>0.
Browse files Browse the repository at this point in the history
Variable-length actions must have a nonzero length; if they don't,
something went wrong and we should bail out.

Suggested-by: Ben Pfaff <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
joestringer committed Mar 8, 2016
1 parent 8a8b8fb commit 847b564
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ofp-actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -7405,7 +7405,7 @@ ofpact_finish(struct ofpbuf *ofpacts, struct ofpact *ofpact)

ovs_assert(ofpact == ofpacts->header);
len = (char *) ofpbuf_tail(ofpacts) - (char *) ofpact;
ovs_assert(len <= UINT16_MAX);
ovs_assert(len > 0 && len <= UINT16_MAX);
ofpact->len = len;
ofpbuf_padto(ofpacts, OFPACT_ALIGN(ofpacts->size));
}
Expand Down

0 comments on commit 847b564

Please sign in to comment.