All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Antill <james-linux-kernel@and.org>
To: linux-kernel@vger.kernel.org
Subject: Bug or dead code in net/unix/af_unix.c:unix_mkname()
Date: Mon, 11 Oct 2004 14:07:49 -0400	[thread overview]
Message-ID: <m3zn2tcemi.fsf@code.and.org> (raw)


 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

                 reply	other threads:[~2004-10-11 18:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3zn2tcemi.fsf@code.and.org \
    --to=james-linux-kernel@and.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.