benjamin.peterson
2008-08-27 00:28:35 UTC
Author: benjamin.peterson
Date: Wed Aug 27 02:28:34 2008
New Revision: 66046
Log:
add NULL checking for PyBytes_FromObject; R=Neal
Modified:
python/branches/py3k/Objects/bytesobject.c
Modified: python/branches/py3k/Objects/bytesobject.c
==============================================================================
--- python/branches/py3k/Objects/bytesobject.c (original)
+++ python/branches/py3k/Objects/bytesobject.c Wed Aug 27 02:28:34 2008
@@ -2932,6 +2932,11 @@
PyObject *new, *it;
Py_ssize_t i, size;
+ if (x == NULL) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
/* Is it an int? */
size = PyNumber_AsSsize_t(x, PyExc_ValueError);
if (size == -1 && PyErr_Occurred()) {
Date: Wed Aug 27 02:28:34 2008
New Revision: 66046
Log:
add NULL checking for PyBytes_FromObject; R=Neal
Modified:
python/branches/py3k/Objects/bytesobject.c
Modified: python/branches/py3k/Objects/bytesobject.c
==============================================================================
--- python/branches/py3k/Objects/bytesobject.c (original)
+++ python/branches/py3k/Objects/bytesobject.c Wed Aug 27 02:28:34 2008
@@ -2932,6 +2932,11 @@
PyObject *new, *it;
Py_ssize_t i, size;
+ if (x == NULL) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
/* Is it an int? */
size = PyNumber_AsSsize_t(x, PyExc_ValueError);
if (size == -1 && PyErr_Occurred()) {