From 6fb628d88daae4989183d7f81eaaffa2186e4381 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Mon, 3 Sep 2018 13:38:40 +0300 Subject: [PATCH] mdbx: require data == NULL for mdbx_cursor_get(MDBX_SET). --- src/mdbx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mdbx.c b/src/mdbx.c index 8ba62f22..96a236dd 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -7665,6 +7665,9 @@ int mdbx_cursor_get(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, return MDBX_INCOMPATIBLE; /* FALLTHRU */ case MDBX_SET: + if (op == MDBX_SET && unlikely(data != NULL)) + return MDBX_EINVAL; + /* FALLTHRU */ case MDBX_SET_KEY: case MDBX_SET_RANGE: if (unlikely(key == NULL))