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 neologix
Recipients giampaolo.rodola, gregory.p.smith, loewis, neologix, pitrou, qyb
Date 2012-04-25.20:57:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335387473.17.0.408009831808.issue1522400@psf.upfronthosting.co.za>
In-reply-to
Content
Actually I think it suffers from the same problem as AF_UNIX: sockaddr_irda->sir_name, like sockaddr_un->sun_path, don't have to be NUL-terminated, and the kernel can return non NUL-terminated strings.
Which means that such code:
        {
            /* regular NULL-terminated string */
            return PyUnicode_DecodeFSDefault(a->sun_path);
        }

or

        return Py_BuildValue("iO&", a->sir_addr,
                                    PyUnicode_DecodeFSDefault, a->sir_name);


can overrung pas sun_path/sir_name, and potentially segfault.
See http://bugs.python.org/issue8372.

What's the simplest way to account for this?
Is there a way to pass PyUnicode_DecodeFSDefault a max length (without having to make an intermediary copy or sir_name, appending a NUL at the end)?
History
Date User Action Args
2012-04-25 20:57:53neologixsetrecipients: + neologix, loewis, gregory.p.smith, pitrou, giampaolo.rodola, qyb
2012-04-25 20:57:53neologixsetmessageid: <1335387473.17.0.408009831808.issue1522400@psf.upfronthosting.co.za>
2012-04-25 20:57:52neologixlinkissue1522400 messages
2012-04-25 20:57:52neologixcreate