buffer overflow

Tim Peters tim.one at comcast.net
Fri Jan 17 20:16:38 CET 2003


[Florian Schulze, on a segfaulting buffer() example]
> This should easily be resolved by proper reference counting. Then it would
> point to the old list object, but I think seen pythonically this is even
> correct.

Nope -- the buffer object captures a memory address not associated with any
Python object, so there's no refcount to *be* bumped.  That memory can get
recycled and the buffer object pointing to it has neither a way to stop ir
nor to know about it when it happens.  Dig into the Python-Dev archive for
years of argument about this.  The current buffer object is plain broken.
That goes a long way toward explaining why you rarely hear about it, BTW
<wink>.

dead-feature-walking-ly y'rs  - tim






More information about the Python-list mailing list