mirror of
https://github.com/isar/libmdbx.git
synced 2025-04-01 02:32:57 +08:00
mdbx: усиление контроля сигнатур курсоров (backport).
This commit is contained in:
parent
1e0a1014a4
commit
5d9fb63fb8
@ -189,9 +189,11 @@ int cursor_shadow(MDBX_cursor *mc, MDBX_txn *nested, const size_t dbi) {
|
|||||||
const size_t size = mc->subcur ? sizeof(MDBX_cursor) + sizeof(subcur_t) : sizeof(MDBX_cursor);
|
const size_t size = mc->subcur ? sizeof(MDBX_cursor) + sizeof(subcur_t) : sizeof(MDBX_cursor);
|
||||||
for (MDBX_cursor *bk; mc; mc = bk->next) {
|
for (MDBX_cursor *bk; mc; mc = bk->next) {
|
||||||
cASSERT(mc, mc != mc->next);
|
cASSERT(mc, mc != mc->next);
|
||||||
bk = mc;
|
if (mc->signature != cur_signature_live) {
|
||||||
if (mc->signature != cur_signature_live)
|
ENSURE(nested->env, mc->signature == cur_signature_wait4eot);
|
||||||
|
bk = mc;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
bk = osal_malloc(size);
|
bk = osal_malloc(size);
|
||||||
if (unlikely(!bk))
|
if (unlikely(!bk))
|
||||||
return MDBX_ENOMEM;
|
return MDBX_ENOMEM;
|
||||||
@ -228,7 +230,7 @@ MDBX_cursor *cursor_eot(MDBX_cursor *mc, MDBX_txn *txn, const bool merge) {
|
|||||||
tASSERT(txn, bk->txn == txn->parent);
|
tASSERT(txn, bk->txn == txn->parent);
|
||||||
/* Zap: Using uninitialized memory '*mc->backup'. */
|
/* Zap: Using uninitialized memory '*mc->backup'. */
|
||||||
MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(6001);
|
MDBX_SUPPRESS_GOOFY_MSVC_ANALYZER(6001);
|
||||||
ENSURE(mc->txn->env, bk->signature == cur_signature_live);
|
ENSURE(txn->env, bk->signature == cur_signature_live);
|
||||||
tASSERT(txn, mx == bk->subcur);
|
tASSERT(txn, mx == bk->subcur);
|
||||||
if (merge) {
|
if (merge) {
|
||||||
/* Update pointers to parent txn */
|
/* Update pointers to parent txn */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user