linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug or dead code in net/unix/af_unix.c:unix_mkname()
@ 2004-10-11 18:07 James Antill
  0 siblings, 0 replies; only message in thread
From: James Antill @ 2004-10-11 18:07 UTC (permalink / raw)
  To: linux-kernel


 unix_mkname() looks like (in both 2.4.x and 2.6.x)...

static int unix_mkname(struct sockaddr_un * sunaddr, int len, unsigned *hashp)
{
        if (len <= sizeof(short) || len > sizeof(*sunaddr))
                return -EINVAL;
[...]
                if (len > sizeof(*sunaddr))
                        len = sizeof(*sunaddr);


...so if you pass a "large" sockaddr_un struct bind() just returns
-EINVAL. I assume that is intentional, but that just makes the huge
comment and test later dead code.

-- 
James Antill

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-11 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 18:07 Bug or dead code in net/unix/af_unix.c:unix_mkname() James Antill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).