From: Jérémie Galarneau Date: Sat, 27 May 2017 10:20:04 +0000 (-0400) Subject: Assert that dynamic buffer size <= capacity X-Git-Tag: v2.11.0-rc1~559 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=4270baeadb2802163c52af9afe7dc0640c9c78ef;p=lttng-tools.git Assert that dynamic buffer size <= capacity Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/dynamic-buffer.c b/src/common/dynamic-buffer.c index f34ae8c49..7184a3400 100644 --- a/src/common/dynamic-buffer.c +++ b/src/common/dynamic-buffer.c @@ -55,6 +55,7 @@ int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer, goto end; } + assert(buffer->capacity >= buffer->size); if (buffer->capacity < (len + buffer->size)) { ret = lttng_dynamic_buffer_set_capacity(buffer, buffer->capacity +