X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/9f6b3bf5187562bac4c96e3ed6a17740d01489fa..a85c067ba6c6940512cf57ec213277a370d87e70:/src/src/lookups/dbmdb.c diff --git a/src/src/lookups/dbmdb.c b/src/src/lookups/dbmdb.c index edc49e581..c99e948b5 100644 --- a/src/src/lookups/dbmdb.c +++ b/src/src/lookups/dbmdb.c @@ -5,6 +5,7 @@ /* Copyright (c) The Exim Maintainers 2020 - 2022 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ +/* SPDX-License-Identifier: GPL-2.0-only */ #include "../exim.h" #include "lf_functions.h" @@ -94,8 +95,10 @@ EXIM_DATUM key, data; exim_datum_init(&key); /* Some DBM libraries require datums to */ exim_datum_init(&data); /* be cleared before use. */ -exim_datum_data_set(&key, string_copyn(keystring, length)); -exim_datum_size_set(&key, length + 1); +length++; +exim_datum_data_set(&key, + memcpy(store_get(length, keystring), keystring, length)); /* key can have embedded NUL */ +exim_datum_size_set(&key, length); if (exim_dbget(d, &key, &data)) {