Ezio Melotti <ezio.melo...@gmail.com> added the comment: I don't know if this is a real problem. If someone who want to crash someone else program is able to do something like 'u.reason = somethingweird' there are already more serious problems to solve. I don't see why someone would want to do that in his own program either.
So, even assuming that PyString_AS_STRING() might indeed crash when some weird arg is passed, the problem should be fixed there and not typechecking all the args before calling it. (i.e. even if you fix it for Exceptions, there are probably several other places where you can set arbitrary things that will be passed to PyString_AS_STRING() anyway.) That said, I played with it and tried to set u.reason with a number of things (including big numbers and strings, Unicode chars outside the BMP, builtin types, functions, modules) and str(u) either returned an empty string or a random sequence of bytes (like your 'E\x03'), but it didn't crash. Unless you can find a way to make it crash, I'd close this as 'invalid'. ---------- nosy: +ezio.melotti priority: -> low stage: -> test needed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7309> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com