[issue25961] Disallow the null character in type name

2015-12-31 Thread Florin Papa
Florin Papa added the comment: Hi all, I fixed a compile error introduced in Python 2.7 by this issue. There is a jump made to an nonexistent label "error" in type_new function in Objects/typeobject.c. Please see the attached patch. Regards, Florin Papa -- nosy: +florin.papa Added

[issue25961] Disallow the null character in type name

2015-12-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 57fea6f75ac2 by Serhiy Storchaka in branch '2.7': Issue #25961: Fixed compilation error and a leak in type constructor. https://hg.python.org/cpython/rev/57fea6f75ac2 -- ___ Python tracker

[issue25961] Disallow the null character in type name

2015-12-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Florin. How could I miss this? But your patch is not correct. It leads to double free and deallocating using non-initialized pointer. It also contains trailing spaces and incorrect indentation. -- ___

[issue25961] Disallow the null character in type name

2015-12-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 29cc6b2f9d28 by Serhiy Storchaka in branch '2.7': Issue #25961: Disallowed null characters in the type name. https://hg.python.org/cpython/rev/29cc6b2f9d28 New changeset d2417971c934 by Serhiy Storchaka in branch '3.5': Issue #25961: Disallowed

[issue25961] Disallow the null character in type name

2015-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because tp_name is a pointer to null-terminated C string and there is no way to distinguish the name containg the null byte from the name terminated by null byte. tp_name is used for example in error messages. >>> t = type('B\0C', (), {}) >>> t.__name__

[issue25961] Disallow the null character in type name

2015-12-29 Thread ppperry
ppperry added the comment: Why are null bytes being excluded from type names in the first place? -- nosy: +ppperry ___ Python tracker ___

[issue25961] Disallow the null character in type name

2015-12-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file41434/type_name_null.patch ___ Python tracker

[issue25961] Disallow the null character in type name

2015-12-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The null character is allowed in __name__ setter (but error message is a little confusing). >>> class A: pass ... >>> A.__name__ = 'B\0' Traceback (most recent call last): File "", line 1, in ValueError: __name__ must not contain null bytes But is