Charles-François Natali <[email protected]> added the comment:
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)?
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com