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 baikie, neologix
Date 2011-08-24.22:35:11
SpamBayes Score 2.1081831e-07
Marked as misclassified No
Message-id <1314225312.16.0.808983714386.issue12837@psf.upfronthosting.co.za>
In-reply-to
Content
I checked in glibc, FreeBSD and OpenBSD source codes, and they all define socklen_t as an unsigned integer.
I think the confusion arises from this:
"""
       The  third argument of accept() was originally declared as an int * (and is that under libc4 and libc5 and on many other systems like 4.x BSD, SunOS 4, SGI); a POSIX.1g
       draft standard wanted to change it into a size_t *, and that is what it is for SunOS 5.  Later POSIX drafts have socklen_t *, and so do the  Single  Unix  Specification
       and glibc2.
"""

But this only implies that sizeof(socklen_t) == sizeof(int).

> since it's set by the kernel.

The only place where we compute it is in sock_sendmsg, but it would be catched by overflow checks:
        if (controllen > SOCKLEN_T_LIMIT || controllen < controllen_last) {
            PyErr_SetString(socket_error, "too much ancillary data");
            goto finally;
        }

And we use it as malloc() and memset() argument before it's checked by cmsg_min_space...
History
Date User Action Args
2011-08-24 22:35:12neologixsetrecipients: + neologix, baikie
2011-08-24 22:35:12neologixsetmessageid: <1314225312.16.0.808983714386.issue12837@psf.upfronthosting.co.za>
2011-08-24 22:35:11neologixlinkissue12837 messages
2011-08-24 22:35:11neologixcreate