Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devious code can crash structseqs #36204

Closed
mwhudson opened this issue Mar 5, 2002 · 2 comments
Closed

devious code can crash structseqs #36204

mwhudson opened this issue Mar 5, 2002 · 2 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mwhudson
Copy link

mwhudson commented Mar 5, 2002

BPO 526039
Nosy @mwhudson

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/mwhudson'
closed_at = <Date 2002-03-06.17:18:42.000>
created_at = <Date 2002-03-05.18:06:22.000>
labels = ['interpreter-core']
title = 'devious code can crash structseqs'
updated_at = <Date 2002-03-06.17:18:42.000>
user = 'https://github.com/mwhudson'

bugs.python.org fields:

activity = <Date 2002-03-06.17:18:42.000>
actor = 'mwh'
assignee = 'mwh'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2002-03-05.18:06:22.000>
creator = 'mwh'
dependencies = []
files = []
hgrepos = []
issue_num = 526039
keywords = []
message_count = 2.0
messages = ['9522', '9523']
nosy_count = 1.0
nosy_names = ['mwh']
pr_nums = []
priority = 'high'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue526039'
versions = ['Python 2.2']

@mwhudson
Copy link
Author

mwhudson commented Mar 5, 2002

Some days you feel that whenever you look closely at
something, you find bugs in it.

>>> import time
>>> class C:
...  def __getitem__(self, i):
...   raise IndexError
...  def __len__(self):
...   return 9
...
>>> time.struct_time(C())
Segmentation fault (core dumped)

This isn't hard to fix (use the PySequence_Fast API),
but I have all sorts of changes in my copy of
Objects/structseq.c and I don't want to forget this.

@mwhudson mwhudson closed this as completed Mar 5, 2002
@mwhudson mwhudson self-assigned this Mar 5, 2002
@mwhudson mwhudson added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 5, 2002
@mwhudson
Copy link
Author

mwhudson commented Mar 6, 2002

Logged In: YES
user_id=6656

Fixed in revision 1.5 of Objects/structseq.c.
Test in revision 1.3 of Lib/test/test_structseq.py.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

1 participant