This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients alexandre.vassalotti, belopolsky
Date 2008-03-07.20:19:22
SpamBayes Score 0.057298604
Marked as misclassified No
Message-id <1204921164.2.0.188543247579.issue1950@psf.upfronthosting.co.za>
In-reply-to
Content
I tried to produce a buffer overflow in get_parent (import.c), but an
attempt to import a module with non-ascii characters is aborted in
getargs.c before get_parent is reached:

>>> __import__("\u0080xyz")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __import__() argument 1 must be string without null bytes,
not str

This looks like a bug.  At the very least the error message is
misleading because there are no null bytes in "\u0080xyz" string.


The offending code is 

                        if ((Py_ssize_t)strlen(*p) !=
PyUnicode_GetSize(arg)) 
                                return converterr("string without null
bytes", 
                                                  arg, msgbuf, bufsize);

at getargs.c:826


However, given the preceding "XXX WAAAAH!" comment, this is probably a
sign of not yet implemented feature rather than a bug.
History
Date User Action Args
2008-03-07 20:19:24belopolskysetspambayes_score: 0.0572986 -> 0.057298604
recipients: + belopolsky, alexandre.vassalotti
2008-03-07 20:19:24belopolskysetspambayes_score: 0.0572986 -> 0.0572986
messageid: <1204921164.2.0.188543247579.issue1950@psf.upfronthosting.co.za>
2008-03-07 20:19:23belopolskylinkissue1950 messages
2008-03-07 20:19:22belopolskycreate