projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Assert that dynamic buffer size <= capacity
[lttng-tools.git]
/
src
/
common
/
dynamic-buffer.c
diff --git
a/src/common/dynamic-buffer.c
b/src/common/dynamic-buffer.c
index ea26a51aca78297cea5b1a7b97840cdec97cf884..7184a3400888ce602c9ec59377ee9c426fc3a5ee 100644
(file)
--- a/
src/common/dynamic-buffer.c
+++ b/
src/common/dynamic-buffer.c
@@
-55,7
+55,8
@@
int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer,
goto end;
}
goto end;
}
- if ((buffer->capacity - buffer->size) < len) {
+ assert(buffer->capacity >= buffer->size);
+ if (buffer->capacity < (len + buffer->size)) {
ret = lttng_dynamic_buffer_set_capacity(buffer,
buffer->capacity +
(len - (buffer->capacity - buffer->size)));
ret = lttng_dynamic_buffer_set_capacity(buffer,
buffer->capacity +
(len - (buffer->capacity - buffer->size)));
This page took
0.024279 seconds
and
4
git commands to generate.