summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-24 12:47:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-24 12:47:28 +0300
commita0f25fe164ac961c683874d9200ea5698ec39509 (patch)
treee887466d45ddf36280fa40e462aee3da3fab3774 /libs
parentd296f9f99daf102b9af5d56690e2bd00d61c1267 (diff)
libmdbx: crash fix
Diffstat (limited to 'libs')
-rw-r--r--libs/libmdbx/src/src/lck-windows.c4
1 files changed, 3 insertions, 1 deletions
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;
}