On Wed, Mar 10, 2004 at 06:42:47PM -0800, nascheme at users.sourceforge.net wrote: > Modified Files: > bufferobject.c > Log Message: > Make buffer objects based on immutable objects (like array) safe. Perfect is the enemy of better. I would appreciate it if people could review this change. The potential for range errors seems high. I tried hard to make the change more easily reviewable (at some cost to the resulting code readability). The mean idea of the change is that instead of using b_ptr and b_size directly, get_buf() is called as necessary to retrieve them. If the buffer is based on memory then b_ptr and b_size are set normally and get_buf() just returns them. If the buffer is based on an object then get_buf() calls the tp_as_buffer method to retrieve them. I believe this fixes the nastier problems of the buffer object. The only remaining problem that I know of is that buffer_hash may not raise a TypeError when it really should. Neil
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4