From a0f25fe164ac961c683874d9200ea5698ec39509 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jul 2018 12:47:28 +0300 Subject: libmdbx: crash fix --- libs/libmdbx/src/src/lck-windows.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/libmdbx/src/src/lck-windows.c b/libs/libmdbx/src/src/lck-windows.c index 327979e653..02b074e9fc 100644 --- a/libs/libmdbx/src/src/lck-windows.c +++ b/libs/libmdbx/src/src/lck-windows.c @@ -199,7 +199,9 @@ static int suspend_and_append(mdbx_handle_array_t **array, (limit * 2 - ARRAY_LENGTH((*array)->handles))); if (!ptr) return MDBX_ENOMEM; - (*array) = (mdbx_handle_array_t *)ptr; + if (limit == ARRAY_LENGTH((*array)->handles)) + memcpy(ptr, *array, sizeof(mdbx_handle_array_t)); + *array = (mdbx_handle_array_t *)ptr; (*array)->limit = limit * 2; } -- cgit v1.2.3