Thu, 03 Oct 2019 11:15:48 +0200
fixes two bugs: clone to uninitialized array and missing return in ucx_array_ensurecap()
src/array.c | file | annotate | diff | comparison | revisions | |
src/ucx/array.h | file | annotate | diff | comparison | revisions | |
test/array_tests.c | file | annotate | diff | comparison | revisions |
--- a/src/array.c Thu Oct 03 10:55:39 2019 +0200 +++ b/src/array.c Thu Oct 03 11:15:48 2019 +0200 @@ -66,6 +66,7 @@ if (ucx_array_reserve(array, required_capacity)) { return 1; } + return 0; } int ucx_array_util_set_a(UcxAllocator* alloc, void** array, size_t* capacity,
--- a/src/ucx/array.h Thu Oct 03 10:55:39 2019 +0200 +++ b/src/ucx/array.h Thu Oct 03 11:15:48 2019 +0200 @@ -188,6 +188,8 @@ * If the destination capacity is insufficient, an automatic reallocation is * attempted. * + * Note: if the destination array is uninitialized, the behavior is undefined. + * * @param dest the array to copy to * @param src the array to copy from * @return zero on success, non-zero on reallocation failure.