From 58f7674fa548a6559307b5bb3d39df42803bea56 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sun, 23 Jul 2017 14:16:19 +0300 Subject: [PATCH] mdbx: fix mdbx_set_attr(). Change-Id: I6628a0629a17f99f39098b8ccb76259cd65dd353 --- src/mdbx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index 72404b38..7b5682da 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -11279,13 +11279,13 @@ int mdbx_set_attr(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, return rc; } - mdbx_attr_t old_attr; + mdbx_attr_t old_attr = 0; rc = mdbx_attr_peek(&old_data, &old_attr); if (unlikely(rc != MDBX_SUCCESS)) return rc; if (old_attr == attr && (!data || (data->iov_len == old_data.iov_len && - memcpy(data->iov_base, old_data.iov_base, + memcmp(data->iov_base, old_data.iov_base, old_data.iov_len) == 0))) return MDBX_SUCCESS;