[issue18339] Segfault in Unpickler_set_memo()

2013-07-01 Thread Christian Heimes
Christian Heimes added the comment: I don't think that a reordered idx < 0 check is going to make any measurable difference. I like the separate checks as they make the code easier to understand. The first check tests for error in PyLong_AsSsize_t() and the second one checks for positive integ

[issue18339] Segfault in Unpickler_set_memo()

2013-07-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa0a03afe359 by Christian Heimes in branch '3.3': Issue #18339: use with self.assertRaises() to make test case more readable http://hg.python.org/cpython/rev/fa0a03afe359 New changeset de44cd866bb0 by Christian Heimes in branch 'default': Issue #183

[issue18339] Segfault in Unpickler_set_memo()

2013-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry that I was late with review. Here is some nitpicks from me. Using assertRaises() as context manager in this case looks cleaner to me: with self.assertRaises(ValueError): unpickler.memo = {-1: None} Moving the `if (idx == -1 && PyErr_Occurre

[issue18339] Segfault in Unpickler_set_memo()

2013-07-01 Thread Christian Heimes
Changes by Christian Heimes : -- resolution: -> fixed stage: needs patch -> commit review status: open -> pending ___ Python tracker ___

[issue18339] Segfault in Unpickler_set_memo()

2013-07-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17b7af660f82 by Christian Heimes in branch '3.3': Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a http://hg.python.org/cpython/rev/17b7af660f82 New changeset f3372692ca20 by Christian Heimes in branch 'default': Issue #1833

[issue18339] Segfault in Unpickler_set_memo()

2013-07-01 Thread Christian Heimes
New submission from Christian Heimes: Unpickler_set_memo() crashes when the unpickler's memo attribute is set to a dict with negative numbers. The descriptor uses _Unpickler_MemoPut() which uses the dict key as index to a C array. Python 3.3.0 (v3.3.0:bd8afb90ebf2, Feb 8 2013, 00:38:29) [GCC