This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: int/long assume that the buffer ends in \0 => CRASH
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, foom, nnorwitz
Priority: high Keywords:

Created on 2006-05-25 15:51 by foom, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg28640 - (view) Author: James Y Knight (foom) Date: 2006-05-25 15:51
But it doesn't, always.

>>> int(buffer('123a', 0, 3))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 123a

Hmmmmmm...well if that works, how about this one:

>>> import array; int(buffer(array.array('c', [])))
***SEGFAULT***

Ah, there we go, a nice crasher.
msg28641 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-05-26 07:02
Logged In: YES 
user_id=33168

Brett, here's an easy one for ya to get started. :-)
msg28642 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-06-08 17:02
Logged In: YES 
user_id=357491

Rev. 46757 has the fix for 2.5 .  Not backporting since it
is a big semantic change and the bug doesn't really cause
issues usually.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43411
2006-05-25 15:51:31foomcreate