]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofpbuf: Reintroduce assertion on size in ofpbuf_pull().
authorBen Pfaff <blp@ovn.org>
Wed, 16 Jan 2019 18:44:07 +0000 (10:44 -0800)
committerBen Pfaff <blp@ovn.org>
Fri, 18 Jan 2019 00:37:31 +0000 (16:37 -0800)
This assertion was removed as part of a commit that was intended to
just be a cleanup.

Fixes: 6fd6ed71cb9f ("ofpbuf: Simplify ofpbuf API.")
Acked-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
include/openvswitch/ofpbuf.h

index dffd78414cedbb425314d0e655afb4c8ff3ef640..71ee0c9534a31060784a890b129d33f910a50192 100644 (file)
@@ -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;