File: OpenSSL/crypto/crypto.c
Function: global_passphrase_callback
Error: ob_refcnt of '*ret' is 1 too high
40 static int
41 global_passphrase_callback(char *buf, int len, int rwflag, void *cb_arg)
42 {
43     PyObject *func, *argv, *ret;
44     int nchars;
45 
46     func = (PyObject *)cb_arg;
47     argv = Py_BuildValue("(i)", rwflag);
when Py_BuildValue() succeeds
48     ret = PyEval_CallObject(func, argv);
when treating unknown void * from OpenSSL/crypto/crypto.c:41 as non-NULL
when PyEval_CallObjectWithKeywords() succeeds
new ref from call to PyEval_CallObjectWithKeywords allocated at:     ret = PyEval_CallObject(func, argv);
ob_refcnt is now refs: 1 + N where N >= 0
49     Py_DECREF(argv);
when taking True path
50     if (ret == NULL)
taking False path
51         return 0;
52     if (!PyBytes_Check(ret))
when considering value == (long int)0 from OpenSSL/crypto/crypto.c:52
taking True path
53     {
54         PyErr_SetString(PyExc_ValueError, "String expected");
calling PyErr_SetString()
55         return 0;
56     }
57     nchars = PyBytes_Size(ret);
58     if (nchars > len)
59         nchars = len;
60     strncpy(buf, PyBytes_AsString(ret), nchars);
61     return nchars;
62 }
ob_refcnt of '*ret' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 17 similar trace(s) to this

File: OpenSSL/crypto/crypto.c
Function: global_passphrase_callback
Error: dereferencing NULL (argv->ob_refcnt) at OpenSSL/crypto/crypto.c:49
40 static int
41 global_passphrase_callback(char *buf, int len, int rwflag, void *cb_arg)
42 {
43     PyObject *func, *argv, *ret;
44     int nchars;
45 
46     func = (PyObject *)cb_arg;
47     argv = Py_BuildValue("(i)", rwflag);
when Py_BuildValue() fails
48     ret = PyEval_CallObject(func, argv);
when treating unknown void * from OpenSSL/crypto/crypto.c:41 as non-NULL
when PyEval_CallObjectWithKeywords() succeeds
49     Py_DECREF(argv);
dereferencing NULL (argv->ob_refcnt) at OpenSSL/crypto/crypto.c:49
found 1 similar trace(s) to this
50     if (ret == NULL)
51         return 0;
52     if (!PyBytes_Check(ret))
53     {
54         PyErr_SetString(PyExc_ValueError, "String expected");
55         return 0;
56     }
57     nchars = PyBytes_Size(ret);
58     if (nchars > len)
59         nchars = len;
60     strncpy(buf, PyBytes_AsString(ret), nchars);
61     return nchars;
62 }