Assert that dynamic buffer size <= capacity
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 10:20:04 +0000 (06:20 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 May 2017 16:39:26 +0000 (12:39 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/dynamic-buffer.c

index f34ae8c492d6bba76818c7e47c004c6f72894bff..7184a3400888ce602c9ec59377ee9c426fc3a5ee 100644 (file)
@@ -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 +
This page took 0.025581 seconds and 4 git commands to generate.