public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Dmitry Chestnyh <d.chestnyh@omp.ru>, libc-alpha@sourceware.org
Subject: Re: [PATCH] [sysdeps] Fix possible null-pointer dereference.
Date: Mon, 13 Jun 2022 12:31:29 +0530	[thread overview]
Message-ID: <c5e54b87-4220-cc90-950a-2fca7516d9f5@gotplt.org> (raw)
In-Reply-To: <20220401062521.514101-1-d.chestnyh@omp.ru>

On 01/04/2022 11:55, Dmitry Chestnyh wrote:
> Without suggested check we can have null-pointer
> dereference at line 257.

How so?  ISTM that for a valid message (which we rely on the kernel to 
provide) you're bound to have at least address or local (and 
consequently address) set at all times.

> ---
>   sysdeps/unix/sysv/linux/check_pf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
> index fe73fe3ba8..5d60e7ac2b 100644
> --- a/sysdeps/unix/sysv/linux/check_pf.c
> +++ b/sysdeps/unix/sysv/linux/check_pf.c
> @@ -237,7 +237,7 @@ make_request (int fd, pid_t pid)
>   				      * sizeof (struct in6addrinfo));
>   		}
>   
> -	      if (!result)
> +	      if (!result || !address)
>   		goto out_fail;
>   
>   	      struct in6addrinfo *info = &result->in6ai[result_len++];


      reply	other threads:[~2022-06-13  7:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  6:25 Dmitry Chestnyh
2022-06-13  7:01 ` Siddhesh Poyarekar [this message]

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=c5e54b87-4220-cc90-950a-2fca7516d9f5@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=d.chestnyh@omp.ru \
    --cc=libc-alpha@sourceware.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).