[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-10-03 Thread Mark Dickinson
Mark Dickinson added the comment: 2.6 fix applied in r75203. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-10-01 Thread Carl Friedrich Bolz
Carl Friedrich Bolz added the comment: [...] > How did you encounter this in the first place? I was working on PyPy's marshaler, broke it in such a way that it was producing the bad input that I gave above. Then I fixed it, but didn't kill my .pyc files. So a few days later I got a long zero

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r75141 (trunk), r75145 (py3k) and r75146 (release31-maint). I'll apply the 2.6 fix once the release26-maint branch is unfrozen. -- versions: -Python 2.4, Python 2.7, Python 3.1, Python 3.2 ___ Python trac

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Changing versions: 3.1 and 3.2 also need fixing (the trunk patch should be easily mergeable); it's not a security issue (AFAIK), so won't be fixed in 2.5. -- priority: -> normal versions: +Python 3.1, Python 3.2 -Python 2.5 ___

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: And a patch for trunk. (Significantly different, because marshal for Python longs was reworked when 30-bit long digits were added.) -- Added file: http://bugs.python.org/file14998/issue7019_trunk.patch ___ Python t

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch for Python 2.6. -- keywords: +patch Added file: http://bugs.python.org/file14997/issue7019_26.patch ___ Python tracker ___ __

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: On second thoughts, I think Carl was right in the first place: it's better to raise an exception. If marshal.loads is getting input that doesn't precisely match the marshal.dumps format, then something's wrong somewhere. Looks like we missed the window for

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: So there are two options: (1) raise an exception, or (2) strip leading zero digits and produce a properly normalized Python long. Do you have any strong preferences? I'm inclined towards (2). How did you encounter this in the first place? --

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Carl Friedrich Bolz
Carl Friedrich Bolz added the comment: Yes, I know :-). I thought I'd report it anyway, as it does more than "just" give you random behavior, but actually produces a broken object. -- ___ Python tracker ___

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report; I'll take a look. Though in general, I think this comes under the heading of 'Don't do that, then.' I suspect there are many ways to produce odd behaviour by feeding malformed input to marshal. See the big pink boxes at: http://docs.p

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Carl Friedrich Bolz
Changes by Carl Friedrich Bolz : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue7019] unmarshaling of artificial strings can produce funny longs.

2009-09-29 Thread Carl Friedrich Bolz
New submission from Carl Friedrich Bolz : When unmarshalling a hand-written string it is possible to break the invariants of longs: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> x = marshal.l