Antoine Pitrou added the comment:

Forget it, can you just try the following patch?

diff --git a/Modules/dbmmodule.c b/Modules/dbmmodule.c
--- a/Modules/dbmmodule.c
+++ b/Modules/dbmmodule.c
@@ -168,11 +168,13 @@
 dbm_contains(register dbmobject *dp, PyObject *v)
 {
     datum key, val;
+    char *ptr;
+    Py_ssize_t size;
 
-    if (PyString_AsStringAndSize(v, (char **)&key.dptr,
-                                 (Py_ssize_t *)&key.dsize)) {
+    if (PyString_AsStringAndSize(v, &ptr, &size))
         return -1;
-    }
+    key.dptr = ptr;
+    key.dsize = size;
 
     /* Expand check_dbmobject_open to return -1 */
     if (dp->di_dbm == NULL) {

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17926>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to