Backport rev 55450:
SF bug #1721309: Clear data so random memory does not get freed.
diff --git a/Misc/NEWS b/Misc/NEWS
index 67c4750..bc0e974 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -35,6 +35,12 @@
run in verbose mode.
+Extension Modules
+-----------------
+
+- Bug #1721309: prevent bsddb module from freeing random memory.
+
+
Documentation
-------------
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 9622c90..f064878 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -1713,6 +1713,7 @@
return NULL;
}
+ CLEAR_DBT(data);
flags |= DB_GET_BOTH;
if (CHECK_DBFLAG(self, DB_THREAD)) {