[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

Antoine Pitrou report at bugs.python.org
Thu Sep 1 14:07:49 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

If you're casting to a larger signed type, then the semantics change, since there is a sign extension.
For example (unsigned int) 0xFFFFFFFF could be cast to (long long) -1.

You could cast to size_t instead and compare the result to SOCKLEN_T_MAX (which currently doesn't exist :-)).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12837>
_______________________________________


More information about the Python-bugs-list mailing list