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.
This commit is contained in:
Neal Norwitz 2007-08-19 04:23:20 +00:00
parent 1836358c01
commit faa54a3929
9 changed files with 29 additions and 20 deletions

View file

@ -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;