Skip to content

Commit

Permalink
ofpbuf: Reintroduce assertion on size in ofpbuf_pull().
Browse files Browse the repository at this point in the history
This assertion was removed as part of a commit that was intended to
just be a cleanup.

Fixes: 6fd6ed7 ("ofpbuf: Simplify ofpbuf API.")
Acked-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
blp committed Jan 18, 2019
1 parent d350b48 commit e300b74
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/openvswitch/ofpbuf.h
Expand Up @@ -246,6 +246,7 @@ static inline void ofpbuf_clear(struct ofpbuf *b)
* 'size' bytes of data. Returns the first byte of data removed. */
static inline void *ofpbuf_pull(struct ofpbuf *b, size_t size)
{
ovs_assert(b->size >= size);
void *data = b->data;
b->data = (char*)b->data + size;
b->size = b->size - size;
Expand Down

0 comments on commit e300b74

Please sign in to comment.