summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-05-05 16:22:54 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2022-05-06 12:47:03 +0100
commit225c84f0f35d3aea1f0845eedde7632c371e1f99 (patch)
treed95b92363005cad3c61f1754be1c528d818cdb9e /src
parente73e1b8f9d4e962041a9e18fb23fc3c3838b055c (diff)
Fix dbmjz lookup. Bug 2884
Broken-by: 0cc804c877
Diffstat (limited to 'src')
-rw-r--r--src/src/lookups/dbmdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/src/lookups/dbmdb.c b/src/src/lookups/dbmdb.c
index edc49e581..32514afcc 100644
--- a/src/src/lookups/dbmdb.c
+++ b/src/src/lookups/dbmdb.c
@@ -94,8 +94,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))
{