ofpbuf: Reintroduce assertion on size in ofpbuf_pull().
This assertion was removed as part of a commit that was intended to
just be a cleanup.
Fixes: ("ofpbuf: Simplify ofpbuf API.")
Acked-by: Justin Pettit
@@ -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;
