[Python-3000-checkins] r66046 - python/branches/py3k/Objects/bytesobject.c

benjamin.peterson python-3000-checkins at python.org
Wed Aug 27 02:28:35 CEST 2008


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()) {


More information about the Python-3000-checkins mailing list