From: Jérémie Galarneau Date: Sat, 27 May 2017 10:20:04 +0000 (-0400) Subject: Assert that dynamic buffer size <= capacity X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=4270baeadb2802163c52af9afe7dc0640c9c78ef;hp=830630679a7fb4bc9b3c7679b5168ee6c03104f1 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 +