pyldb: fix uninitialized memory bug in PyArg_ParseTuple() argument
authorStefan Metzmacher <metze@samba.org>
Mon, 8 Aug 2011 11:21:18 +0000 (13:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 8 Aug 2011 14:45:27 +0000 (16:45 +0200)
"s#", &str, &len) required 'len' as 'int' not as 'Py_ssize_t'.
With Py_ssize_t the 2nd half of a 64bit Py_ssize_t, will be
uninitialized as 'int' is only 32bit.

metze

lib/ldb/pyldb.c

index 87b23078964fab27b3b3d2ef3fd319b5d111833e..218505dd8c5e91bf899c3a38247b3bc1c9e19a6e 100644 (file)
@@ -3201,7 +3201,7 @@ static PyObject *py_valid_attr_name(PyObject *self, PyObject *args)
 static PyObject *py_binary_encode(PyObject *self, PyObject *args)
 {
        char *str, *encoded;
-       Py_ssize_t size;
+       int size = 0;
        struct ldb_val val;
        PyObject *ret;