A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-October/083177.html below:

[Python-Dev] Proper initialization of structs

[Python-Dev] Proper initialization of structs [Python-Dev] Proper initialization of structsGuido van Rossum guido at python.org
Thu Oct 30 18:00:03 CET 2008
Yes, that's what __new__ / tp_new is for! Thanks for finding this.

On Thu, Oct 30, 2008 at 7:20 AM, Christian Heimes <lists at cheimes.de> wrote:
> I like to raise attention for a problem revealed by
> http://bugs.python.org/issue4237
>
> ---
> The bug was caused by a design flaw -- which was partly my fault. Some
> elements of the PyFileIOObject struct were initialized in __new__ while
> other parts were initialized in __init__. I've moved the initialization
> to __new__.
>
> We should add a rule that all struct members must be properly
> initialized in __new__. In the past Victor's fuzzying tool has revealed
> several crashers related to similar design flaws.
>
> I'm raising the severity of the bug to release blocker because I can't
> predict if the problem can be abused to crash the interpreter. We should
> also review all __new__ and __init__ methods of objects and extension
> modules for similar issues.
> ---
>
> The same design flaw was responsible for bugs like the pickle crasher
> http://bugs.python.org/issue3664. I like to establish a rule that *all*
> struct members must be initialized properly in the type's tp_new function.
>
> Comments?
>
> Christian
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/guido%40python.org
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4