summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-19 04:23:20 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-19 04:23:20 (GMT)
commitfaa54a392951468090f0095ffa927b16fcb20ca4 (patch)
treea8586a5cc833217e6b1eaf4d052313475534178a /Include
parent1836358c016cd7f5117f4f34fa3a27c5701e8265 (diff)
downloadcpython-faa54a392951468090f0095ffa927b16fcb20ca4.zip
cpython-faa54a392951468090f0095ffa927b16fcb20ca4.tar.gz
cpython-faa54a392951468090f0095ffa927b16fcb20ca4.tar.bz2
Code review of the new buffer protocol. Mostly add questions that should
be answered with the comments removed. There are many places that require checks when doing arithmetic for memory sizes when allocating memory. Otherwise, overflow is possible with a subsequent crash. Fix SF #1777057 which was a result of not initializing the new BufferError properly. Had to update the test for exceptions for BufferError too.
Diffstat (limited to 'Include')
-rw-r--r--Include/bytesobject.h1
-rw-r--r--Include/object.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/Include/bytesobject.h b/Include/bytesobject.h
index 12ecf64..729af39 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -21,6 +21,7 @@ extern "C" {
/* Object layout */
typedef struct {
PyObject_VAR_HEAD
+ /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
int ob_exports; /* how many buffer exports */
Py_ssize_t ob_alloc; /* How many bytes allocated */
char *ob_bytes;
diff --git a/Include/object.h b/Include/object.h
index d936bca..dfabefd 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -147,7 +147,7 @@ typedef struct bufferinfo {
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
- int ndim;
+ int ndim; /* XXX(nnorwitz): should be Py_ssize_t??? */
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;