MXS-2495 No nulls for GWBUF_IS_CONTIGUOUS()

The macro GWBUF_IS_CONTIGOUS() and the actual implementation
gwbuf_is_contiguous() can only be called with a non-NULL pointer.
This commit is contained in:
Johan Wikman 2019-05-20 11:16:50 +03:00
parent 68ad51bc52
commit 6317a86c69

View File

@ -154,7 +154,13 @@ inline size_t gwbuf_link_length(const GWBUF* b)
#define GWBUF_LENGTH(b) gwbuf_link_length(b)
/*< Check whether the buffer is contiguous*/
#define GWBUF_IS_CONTIGUOUS(b) (((b) == NULL) || ((b)->next == NULL))
inline bool gwbuf_is_contiguous(const GWBUF* b)
{
mxb_assert(b);
return b->next == nullptr;
}
#define GWBUF_IS_CONTIGUOUS(b) gwbuf_is_contiguous(b)
/*< True if all bytes in the buffer have been consumed */
inline bool gwbuf_link_empty(const GWBUF* b)