]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9378 don't try to print oversized keys in debug msg
authorHoward Chu <hyc@openldap.org>
Mon, 17 Jun 2024 16:06:19 +0000 (17:06 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 17 Jun 2024 16:06:19 +0000 (17:06 +0100)
libraries/liblmdb/mdb.c

index 3914658b563aae43a438311a60fcea54dd30a164..9ec7305efc9f73404726cb8a122bb6188eb2c61c 100644 (file)
@@ -1999,8 +1999,10 @@ mdb_dval(MDB_txn *txn, MDB_dbi dbi, MDB_val *data, char *buf)
 {
        if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) {
                mdb_dkey(data, buf+1);
-               *buf = '[';
-               strcpy(buf + data->mv_size * 2 + 1, "]");
+               if (data->mv_size < DKBUF_MAXKEYSIZE - 2) {
+                       *buf = '[';
+                       strcpy(buf + data->mv_size * 2 + 1, "]");
+               }
        } else
                *buf = '\0';
        return buf;