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.10.0-rc2~39 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=929acf432c97533a3e447ad2659d27dab74ae63f;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 +