Kaydet (Commit) 4b24a42f authored tarafından Benjamin Peterson's avatar Benjamin Peterson

add NULL checking for PyBytes_FromObject; R=Neal

üst f4ff4702
...@@ -2932,6 +2932,11 @@ PyBytes_FromObject(PyObject *x) ...@@ -2932,6 +2932,11 @@ PyBytes_FromObject(PyObject *x)
PyObject *new, *it; PyObject *new, *it;
Py_ssize_t i, size; Py_ssize_t i, size;
if (x == NULL) {
PyErr_BadInternalCall();
return NULL;
}
/* Is it an int? */ /* Is it an int? */
size = PyNumber_AsSsize_t(x, PyExc_ValueError); size = PyNumber_AsSsize_t(x, PyExc_ValueError);
if (size == -1 && PyErr_Occurred()) { if (size == -1 && PyErr_Occurred()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment