Message159338
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)? |
|
Date |
User |
Action |
Args |
2012-04-25 20:57:53 | neologix | set | recipients:
+ neologix, loewis, gregory.p.smith, pitrou, giampaolo.rodola, qyb |
2012-04-25 20:57:53 | neologix | set | messageid: <1335387473.17.0.408009831808.issue1522400@psf.upfronthosting.co.za> |
2012-04-25 20:57:52 | neologix | link | issue1522400 messages |
2012-04-25 20:57:52 | neologix | create | |
|